Skip to content

Commit 291691c

Browse files
committed
ci: publish release images to quay.io
In the release podvm publish worfklow we mirror the ghcr image to quay. Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
1 parent 5dbde60 commit 291691c

2 files changed

Lines changed: 43 additions & 2 deletions

File tree

.github/workflows/podvm_publish.yaml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99
inputs:
1010
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)'
1212
required: false
1313
type: string
1414
default: ''
@@ -25,13 +25,20 @@ on:
2525
type: string
2626
default: ''
2727
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)'
2929
required: false
3030
type: string
3131
default: ''
32+
secrets:
33+
QUAY_PASSWORD:
34+
required: false
3235

3336
permissions: {}
3437

38+
concurrency:
39+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.git_ref }}
40+
cancel-in-progress: true
41+
3542
jobs:
3643
podvm:
3744
uses: ./.github/workflows/podvm_mkosi.yaml
@@ -50,3 +57,35 @@ jobs:
5057
image_tag: ${{ inputs.image_tag || github.sha }}
5158
arch: ${{ matrix.arch}}
5259
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"

.github/workflows/release.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
id-token: write # Required for attestation signing
4545
attestations: write # Required for persisting attestations
4646
artifact-metadata: write # Required by podvm_mkosi.yaml to write attestation metadata
47+
secrets:
48+
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
4749

4850
podvm-byom-binaries:
4951
needs: podvm-images # Depends on podvm-binaries-ubuntu-{arch} images

0 commit comments

Comments
 (0)