Skip to content

Commit fa3a366

Browse files
authored
ci: multi-platform docker build (#159)
1 parent 6c6a780 commit fa3a366

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Diff for: .github/workflows/docker.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,34 @@ jobs:
3333

3434
steps:
3535
- name: Checkout
36-
uses: actions/checkout@v3
36+
uses: actions/checkout@v4
3737

3838
- name: Log in to the Container registry
39-
uses: docker/login-action@v2
39+
uses: docker/login-action@v3
4040
with:
4141
registry: ${{ env.REGISTRY }}
4242
username: ${{ github.actor }}
4343
password: ${{ secrets.GITHUB_TOKEN }}
4444

45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@v3
47+
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v3
50+
4551
- name: Extract metadata (tags, labels) for Docker
4652
id: meta
47-
uses: docker/metadata-action@v4
53+
uses: docker/metadata-action@v5
4854
with:
4955
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
5056

5157
- name: Build and push
52-
uses: docker/build-push-action@v4
58+
uses: docker/build-push-action@v5
5359
with:
5460
file: Dockerfile
55-
push: ${{ startsWith(github.ref, 'refs/tags') }} # push image only for tags
61+
push: ${{ startsWith(github.ref, 'refs/tags') }}
62+
platforms: linux/amd64,linux/arm64
5663
tags: ${{ steps.meta.outputs.tags }}
5764
labels: ${{ steps.meta.outputs.labels }}
65+
cache-from: type=gha
66+
cache-to: type=gha

0 commit comments

Comments
 (0)