Skip to content

Commit e13e79e

Browse files
committed
Update Docker workflow to support multi-arch builds and tag versioning
1 parent f6180b9 commit e13e79e

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,40 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v3
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
1723
- name: Login to Docker Hub
1824
uses: docker/login-action@v3
1925
with:
2026
username: ${{ secrets.DOCKERHUB_USERNAME }}
2127
password: ${{ secrets.DOCKERHUB_TOKEN }}
2228

29+
- name: Extract tag name
30+
id: tag
31+
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
32+
2333
- name: Build and push Frontend
2434
uses: docker/build-push-action@v5
2535
with:
2636
context: ./frontend
2737
file: ./frontend/Dockerfile.prod
2838
push: true
29-
tags: bangertech/bambucam-frontend:latest
39+
platforms: linux/amd64,linux/arm64
40+
tags: |
41+
bangertech/bambucam-frontend:latest
42+
bangertech/bambucam-frontend:${{ steps.tag.outputs.TAG }}
3043
3144
- name: Build and push Backend
3245
uses: docker/build-push-action@v5
3346
with:
3447
context: ./backend
3548
file: ./backend/Dockerfile.prod
3649
push: true
37-
tags: bangertech/bambucam-backend:latest
50+
platforms: linux/amd64,linux/arm64
51+
tags: |
52+
bangertech/bambucam-backend:latest
53+
bangertech/bambucam-backend:${{ steps.tag.outputs.TAG }}

0 commit comments

Comments
 (0)