Skip to content

Commit a352bae

Browse files
committed
GitHub Actions: multi-platform container builder
1 parent fb0d28a commit a352bae

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/publish-container.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@ jobs:
2727
packages: write
2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v2
30+
uses: actions/checkout@v4
31+
32+
# Set up QEMU for multi-platform build
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
3138

3239
# Login against a Docker registry except on PR
3340
# https://github.com/docker/login-action
3441
- name: Log into registry ${{ env.REGISTRY }}
3542
if: github.event_name != 'pull_request'
36-
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
43+
uses: docker/login-action@v3
3744
with:
3845
registry: ${{ env.REGISTRY }}
3946
username: ${{ github.actor }}
@@ -43,16 +50,17 @@ jobs:
4350
# https://github.com/docker/metadata-action
4451
- name: Extract Docker metadata
4552
id: meta
46-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
53+
uses: docker/metadata-action@v5
4754
with:
4855
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4956

5057
# Build and push Docker image with Buildx (don't push on PR)
5158
# https://github.com/docker/build-push-action
5259
- name: Build and push Docker image
53-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
60+
uses: docker/build-push-action@v5
5461
with:
5562
context: .
63+
platforms: linux/amd64,linux/arm64
5664
push: ${{ github.event_name != 'pull_request' }}
5765
tags: ${{ steps.meta.outputs.tags }}
5866
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)