Skip to content

Commit e87616d

Browse files
committed
feat: add multiarch build for amd64 and arm64/v8
1 parent 886ddfa commit e87616d

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/build_container.yml renamed to .github/workflows/build_image.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- v*
99

1010
jobs:
11-
build-and-push-image:
11+
build-and-push-images:
1212
runs-on: ubuntu-latest
1313

1414
permissions:
@@ -19,15 +19,23 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@v4
2121

22+
- name: Set up QEMU for multi-arch builds
23+
uses: docker/setup-qemu-action@v3
24+
25+
- name: Set up Docker Buildx
26+
id: buildx
27+
uses: docker/setup-buildx-action@v3
28+
2229
- name: Log in to the Container registry
2330
uses: docker/login-action@v3
2431
with:
2532
registry: ghcr.io
2633
username: ${{ github.repository_owner }}
2734
password: ${{ secrets.GITHUB_TOKEN }}
2835

29-
- name: Extract metadata (tags, labels) for Docker
30-
id: meta
36+
# Extract tags with suffixes for prod and worker
37+
- name: Extract metadata (tags, labels) for Docker (prod)
38+
id: meta_prod
3139
uses: docker/metadata-action@v5
3240
with:
3341
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
@@ -37,12 +45,14 @@ jobs:
3745
type=semver,pattern={{major}}
3846
type=edge,branch=main
3947
40-
- name: Build and push Docker image
48+
# Build and push multi-arch prod image
49+
- name: Build and push prod Docker image (Multi-Arch)
4150
uses: docker/build-push-action@v6
4251
with:
4352
context: .
4453
file: ./Dockerfile
4554
push: true
46-
tags: ${{ steps.meta.outputs.tags }}
47-
labels: ${{ steps.meta.outputs.labels }}
48-
target: prod
55+
platforms: linux/amd64,linux/arm64/v8
56+
tags: ${{ steps.meta_prod.outputs.tags }}
57+
labels: ${{ steps.meta_prod.outputs.labels }}
58+
target: prod

0 commit comments

Comments
 (0)