Skip to content

Commit 073b983

Browse files
committed
Produce multi-arch images
1 parent 826d21d commit 073b983

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/docker-image.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,49 @@ jobs:
1616
strategy:
1717
matrix:
1818
tag: ["alpine", "clang-tools", "cpp", "package", "qt", "snap", "docker-cli", "sphinx"]
19+
include:
20+
- tag: alpine
21+
platforms: linux/amd64,linux/arm64
22+
- tag: cpp
23+
platforms: linux/amd64,linux/arm64
1924
permissions:
2025
contents: read
2126
packages: write
2227

2328
steps:
2429
- name: Checkout repository
25-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
if: matrix.platforms != ''
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
if: matrix.platforms != ''
2639

2740
- name: Log in to the Container registry
28-
uses: docker/login-action@v2
41+
uses: docker/login-action@v3
2942
with:
3043
registry: ${{ env.REGISTRY }}
3144
username: ${{ github.actor }}
3245
password: ${{ secrets.GITHUB_TOKEN }}
3346

3447
- name: Extract metadata (tags, labels) for Docker
3548
id: meta
36-
uses: docker/metadata-action@v4
49+
uses: docker/metadata-action@v5
3750
with:
3851
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3952
tags: |
4053
type=raw,value=${{ matrix.tag }}
4154
4255
- name: Build and push Docker image
43-
uses: docker/build-push-action@v4
56+
uses: docker/build-push-action@v5
4457
with:
4558
context: .
4659
file: Dockerfile.${{ matrix.tag }}
4760
push: true
4861
pull: true
4962
tags: ${{ steps.meta.outputs.tags }}
5063
labels: ${{ steps.meta.outputs.labels }}
64+
platforms: ${{ matrix.platforms }}

0 commit comments

Comments
 (0)