Skip to content

Commit ef686ae

Browse files
authored
Refactor Docker workflow for multi-arch builds
1 parent f31155e commit ef686ae

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

.github/workflows/Docker.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,46 @@ jobs:
2121
dockerfile: apps/OpenSign/Dockerhubfile
2222
- image: opensign/opensignserver
2323
dockerfile: apps/OpenSignServer/Dockerhubfile
24+
2425
steps:
25-
-
26-
name: Checkout
26+
- name: Checkout
2727
uses: actions/checkout@v3
28-
-
29-
name: Login to Docker Hub
28+
29+
# 👇 Enable emulation so we can build for arm64 on amd64 runners
30+
- name: Set up QEMU
31+
uses: docker/setup-qemu-action@v2
32+
with:
33+
platforms: linux/amd64,linux/arm64
34+
35+
# 👇 Enable Buildx for multi-arch builds
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v2
38+
39+
- name: Login to Docker Hub
3040
uses: docker/login-action@v2
3141
with:
3242
username: ${{ secrets.DOCKERHUB_USERNAME }}
3343
password: ${{ secrets.DOCKERHUB_TOKEN }}
34-
-
35-
name: Extract metadata (tags, labels) for Docker
44+
45+
- name: Extract metadata (tags, labels) for Docker
3646
id: meta
3747
uses: docker/metadata-action@v4
3848
with:
3949
images: ${{ matrix.image }}
40-
-
41-
name: Debug - List files opensign
50+
51+
- name: Debug - List files opensign
4252
run: ls -R apps/OpenSign/ # Adjust the path as needed
43-
-
44-
name: Debug - List files opensignserver
53+
54+
- name: Debug - List files opensignserver
4555
run: ls -R apps/OpenSignServer/ # Adjust the path as needed
46-
-
47-
name: Build and push
56+
57+
- name: Build and push (multi-arch)
4858
uses: docker/build-push-action@v4
4959
with:
5060
context: .
5161
file: ${{ matrix.dockerfile }}
5262
push: true
63+
# 👇 Build for both AMD64 & ARM64
64+
platforms: linux/amd64,linux/arm64
5365
tags: ${{ steps.meta.outputs.tags }}
5466
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)