Skip to content

Commit 9c575ac

Browse files
guguclaude
andcommitted
Remove QEMU setup from Quay workflow
Use native ARM64 runner for ARM64 builds instead of QEMU emulation, which is faster and more reliable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 56e7c4e commit 9c575ac

1 file changed

Lines changed: 161 additions & 0 deletions

File tree

.github/workflows/quay.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Push to Quay.io
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
env:
9+
REGISTRY: quay.io
10+
REGISTRY_IMAGE: quay.io/rocketadmin/rocketadmin
11+
12+
jobs:
13+
prepare:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
matrix: ${{ steps.platforms.outputs.matrix }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Create matrix
22+
id: platforms
23+
run: |
24+
echo "matrix=$(docker buildx bake image-all -f docker-bake.hcl --print | jq -cr '.target."image-all".platforms')" >>${GITHUB_OUTPUT}
25+
26+
- name: Show matrix
27+
run: |
28+
echo ${{ steps.platforms.outputs.matrix }}
29+
30+
- name: Docker meta
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ${{ env.REGISTRY_IMAGE }}
35+
tags: |
36+
type=semver,pattern={{version}}
37+
type=semver,pattern={{major}}.{{minor}}
38+
type=semver,pattern={{major}}
39+
type=ref,event=tag
40+
41+
- name: Rename meta bake definition file
42+
run: |
43+
mv "${{ steps.meta.outputs.bake-file }}" "/tmp/bake-meta.json"
44+
45+
- name: Upload meta bake definition
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: bake-meta
49+
path: /tmp/bake-meta.json
50+
if-no-files-found: error
51+
retention-days: 1
52+
53+
build:
54+
permissions:
55+
id-token: write
56+
contents: read
57+
attestations: write
58+
runs-on: ${{ contains(matrix.platform, 'arm') && 'arm64' || 'ubuntu-latest' }}
59+
needs:
60+
- prepare
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
platform: ${{ fromJson(needs.prepare.outputs.matrix) }}
65+
steps:
66+
- name: Prepare
67+
run: |
68+
platform=${{ matrix.platform }}
69+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
70+
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
74+
- name: Download meta bake definition
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: bake-meta
78+
path: /tmp
79+
80+
- name: Set up Docker Buildx
81+
uses: docker/setup-buildx-action@v3
82+
83+
- name: Login to Quay.io
84+
uses: docker/login-action@v3
85+
with:
86+
registry: ${{ env.REGISTRY }}
87+
username: ${{ secrets.QUAY_USERNAME }}
88+
password: ${{ secrets.QUAY_PASSWORD }}
89+
90+
- name: Build
91+
id: bake
92+
uses: docker/bake-action@v5
93+
with:
94+
sbom: true
95+
files: |
96+
./docker-bake.hcl
97+
/tmp/bake-meta.json
98+
targets: image
99+
set: |
100+
*.tags=
101+
*.platform=${{ matrix.platform }}
102+
*.output=type=image,"name=${{ env.REGISTRY_IMAGE }}",push-by-digest=true,name-canonical=true,push=true
103+
104+
- name: Export digest
105+
run: |
106+
mkdir -p /tmp/digests
107+
digest="${{ fromJSON(steps.bake.outputs.metadata).image['containerimage.digest'] }}"
108+
touch "/tmp/digests/${digest#sha256:}"
109+
110+
- name: Upload digest
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: digests-${{ env.PLATFORM_PAIR }}
114+
path: /tmp/digests/*
115+
if-no-files-found: error
116+
retention-days: 1
117+
118+
- name: Attest Build Provenance
119+
uses: actions/attest-build-provenance@v1
120+
with:
121+
subject-digest: "${{ fromJSON(steps.bake.outputs.metadata).image['containerimage.digest'] }}"
122+
push-to-registry: false
123+
subject-name: ${{ env.REGISTRY_IMAGE }}
124+
125+
merge:
126+
runs-on: ubuntu-latest
127+
needs:
128+
- build
129+
steps:
130+
- name: Download meta bake definition
131+
uses: actions/download-artifact@v4
132+
with:
133+
name: bake-meta
134+
path: /tmp
135+
136+
- name: Download digests
137+
uses: actions/download-artifact@v4
138+
with:
139+
path: /tmp/digests
140+
pattern: digests-*
141+
merge-multiple: true
142+
143+
- name: Set up Docker Buildx
144+
uses: docker/setup-buildx-action@v3
145+
146+
- name: Login to Quay.io
147+
uses: docker/login-action@v3
148+
with:
149+
registry: ${{ env.REGISTRY }}
150+
username: ${{ secrets.QUAY_USERNAME }}
151+
password: ${{ secrets.QUAY_PASSWORD }}
152+
153+
- name: Create manifest list and push
154+
working-directory: /tmp/digests
155+
run: |
156+
docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.REGISTRY_IMAGE }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \
157+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
158+
159+
- name: Inspect image
160+
run: |
161+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)

0 commit comments

Comments
 (0)