Skip to content

Commit 375aeb0

Browse files
committed
CI: push frontend and node separately for faster builds
1 parent 19cf7da commit 375aeb0

File tree

1 file changed

+43
-19
lines changed

1 file changed

+43
-19
lines changed

.github/workflows/docker.yaml

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,11 @@ jobs:
110110
if-no-files-found: error
111111
retention-days: 1
112112

113-
# Create and push multi-arch manifests for production releases
114-
push-multi-arch-images:
113+
# Push frontend multi-arch manifest
114+
push-frontend-image:
115115
runs-on: ubuntu-latest
116116
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
117117
needs:
118-
- build-mina-node-image
119118
- build-mina-frontend-image
120119
steps:
121120
- name: Login to Docker Hub
@@ -138,22 +137,6 @@ jobs:
138137
- name: Set up Docker Buildx
139138
uses: docker/setup-buildx-action@v3
140139

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
151-
run: |
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
157140
- name: Download mina-rust-frontend digests
158141
uses: actions/download-artifact@v4
159142
with:
@@ -167,3 +150,44 @@ jobs:
167150
docker buildx imagetools create \
168151
--tag ${{ env.REGISTRY_FRONTEND_IMAGE }}:${{ env.GIT_COMMIT }} \
169152
$(printf '${{ env.REGISTRY_FRONTEND_IMAGE }}@sha256:%s ' *)
153+
154+
# Push node multi-arch manifest (after node build completes)
155+
push-node-image:
156+
runs-on: ubuntu-latest
157+
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
158+
needs:
159+
- build-mina-node-image
160+
steps:
161+
- name: Login to Docker Hub
162+
uses: docker/login-action@v3
163+
with:
164+
username: ${{ secrets.DOCKERHUB_USERNAME }}
165+
password: ${{ secrets.DOCKERHUB_TOKEN }}
166+
167+
- name: Set up environment variables
168+
run: |
169+
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
170+
echo "GIT_COMMIT=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
171+
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
172+
echo "GIT_COMMIT=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
173+
elif [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
174+
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
175+
echo "GIT_COMMIT=${BRANCH_NAME}" >> $GITHUB_ENV
176+
fi
177+
178+
- name: Set up Docker Buildx
179+
uses: docker/setup-buildx-action@v3
180+
181+
- name: Download mina-rust digests
182+
uses: actions/download-artifact@v4
183+
with:
184+
path: /tmp/mina-digests
185+
pattern: node-digests-*
186+
merge-multiple: true
187+
188+
- name: Create mina-rust manifest list and push
189+
working-directory: /tmp/mina-digests
190+
run: |
191+
docker buildx imagetools create \
192+
--tag ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.GIT_COMMIT }} \
193+
$(printf '${{ env.REGISTRY_NODE_IMAGE }}@sha256:%s ' *)

0 commit comments

Comments
 (0)