|
8 | 8 | workflow_dispatch: |
9 | 9 | inputs: |
10 | 10 | registry: |
11 | | - description: 'Container registry to push images to (e.g., quay.io/your-username)' |
| 11 | + description: 'Alternative container registry to push images to (e.g., quay.io/your-username)' |
12 | 12 | required: false |
13 | 13 | type: string |
14 | 14 | default: '' |
|
25 | 25 | type: string |
26 | 26 | default: '' |
27 | 27 | registry: |
28 | | - description: 'Container registry to push images to (e.g., quay.io/your-username)' |
| 28 | + description: 'Alternative container registry to push images to (e.g., quay.io/your-username)' |
29 | 29 | required: false |
30 | 30 | type: string |
31 | 31 | default: '' |
| 32 | + secrets: |
| 33 | + QUAY_PASSWORD: |
| 34 | + required: false |
32 | 35 |
|
33 | 36 | permissions: {} |
34 | 37 |
|
| 38 | +concurrency: |
| 39 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.git_ref }} |
| 40 | + cancel-in-progress: true |
| 41 | + |
35 | 42 | jobs: |
36 | 43 | podvm: |
37 | 44 | uses: ./.github/workflows/podvm_mkosi.yaml |
|
50 | 57 | image_tag: ${{ inputs.image_tag || github.sha }} |
51 | 58 | arch: ${{ matrix.arch}} |
52 | 59 | debug: false |
| 60 | + |
| 61 | + push-to-quay: |
| 62 | + name: Push podvm image to quay.io |
| 63 | + permissions: |
| 64 | + packages: read # Required to copy container images |
| 65 | + needs: podvm |
| 66 | + if: ${{ startsWith(inputs.registry, 'quay.io') }} |
| 67 | + runs-on: ubuntu-latest |
| 68 | + steps: |
| 69 | + - name: Login to ghcr.io container registry |
| 70 | + uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0 |
| 71 | + with: |
| 72 | + registry: ghcr.io |
| 73 | + username: ${{ github.actor }} |
| 74 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + |
| 76 | + - name: Login to quay.io container registry |
| 77 | + uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0 |
| 78 | + with: |
| 79 | + registry: quay.io |
| 80 | + username: ${{ vars.QUAY_USERNAME }} |
| 81 | + password: ${{ secrets.QUAY_PASSWORD }} |
| 82 | + |
| 83 | + - uses: oras-project/setup-oras@1d808f7d7f6995cc68b7bf507bfe5c5446e1dc9d # v2.0.1 |
| 84 | + |
| 85 | + - name: Push podvm image to quay.io |
| 86 | + env: |
| 87 | + REGISTRY: ${{ inputs.registry }} |
| 88 | + GHCR_IMAGE: ${{ needs.podvm.outputs.qcow2_oras_image }} |
| 89 | + run: | |
| 90 | + quay_image="${REGISTRY}/$(basename "$GHCR_IMAGE")" |
| 91 | + oras cp "$GHCR_IMAGE" "$quay_image" |
0 commit comments