Skip to content

Commit c71ab72

Browse files
committed
CI: fix multi-arch push to Dockerhub
1 parent 827d6f2 commit c71ab72

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed

.github/workflows/docker.yaml

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ env:
99

1010
jobs:
1111
build-mina-node-image:
12-
if: github.ref != 'refs/heads/develop' && !startsWith(github.ref, 'refs/tags/')
1312
timeout-minutes: 40
1413
strategy:
1514
matrix:
@@ -62,7 +61,6 @@ jobs:
6261

6362
# Frontend
6463
build-mina-frontend-image:
65-
if: github.ref != 'refs/heads/develop' && !startsWith(github.ref, 'refs/tags/')
6664
timeout-minutes: 5
6765
strategy:
6866
matrix:
@@ -112,26 +110,14 @@ jobs:
112110
if-no-files-found: error
113111
retention-days: 1
114112

115-
# Push images to registry
116-
push-images:
117-
strategy:
118-
matrix:
119-
arch:
120-
- platform: linux/amd64
121-
runs-on: ubuntu-latest
122-
- platform: linux/arm64
123-
runs-on: ubuntu-24.04-arm
124-
runs-on: ${{ matrix.arch.runs-on }}
113+
# Create and push multi-arch manifests for production releases
114+
push-multi-arch-images:
115+
runs-on: ubuntu-latest
125116
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
117+
needs:
118+
- build-mina-node-image
119+
- build-mina-frontend-image
126120
steps:
127-
- name: Git checkout
128-
uses: actions/checkout@v5
129-
130-
# This is needed so that we can get the current version with vergen
131-
- name: Fetch tag for current commit
132-
run: |
133-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
134-
135121
- name: Login to Docker Hub
136122
uses: docker/login-action@v3
137123
with:
@@ -149,12 +135,35 @@ jobs:
149135
echo "GIT_COMMIT=${BRANCH_NAME}" >> $GITHUB_ENV
150136
fi
151137
152-
- name: Build and push mina-rust image
138+
- name: Set up Docker Buildx
139+
uses: docker/setup-buildx-action@v3
140+
141+
# Create mina-rust multi-arch manifest
142+
- name: Download mina-rust digests
143+
uses: actions/download-artifact@v4
144+
with:
145+
path: /tmp/mina-digests
146+
pattern: node-digests-*
147+
merge-multiple: true
148+
149+
- name: Create mina-rust manifest list and push
150+
working-directory: /tmp/mina-digests
153151
run: |
154-
make docker-build-mina
155-
make docker-push-mina
152+
docker buildx imagetools create \
153+
--tag ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.GIT_COMMIT }} \
154+
$(printf '${{ env.REGISTRY_NODE_IMAGE }}@sha256:%s ' *)
155+
156+
# Create mina-rust-frontend multi-arch manifest
157+
- name: Download mina-rust-frontend digests
158+
uses: actions/download-artifact@v4
159+
with:
160+
path: /tmp/frontend-digests
161+
pattern: frontend-*-digests-*
162+
merge-multiple: true
156163

157-
- name: Build and push mina-rust-frontend image
164+
- name: Create mina-rust-frontend manifest list and push
165+
working-directory: /tmp/frontend-digests
158166
run: |
159-
make docker-build-frontend
160-
make docker-push-frontend
167+
docker buildx imagetools create \
168+
--tag ${{ env.REGISTRY_FRONTEND_IMAGE }}:${{ env.GIT_COMMIT }} \
169+
$(printf '${{ env.REGISTRY_FRONTEND_IMAGE }}@sha256:%s ' *)

0 commit comments

Comments
 (0)