Skip to content

Commit c6d947b

Browse files
Add multi-platform support (linux/amd64, linux/arm64)
1 parent 00e81d1 commit c6d947b

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
name: Build and publish Docker image
2-
32
# Executes automatically when pushing to master
43
on:
54
push:
65
branches: ['master']
7-
86
env:
97
REGISTRY: ghcr.io
108
IMAGE_NAME: ${{ github.repository }}
11-
129
jobs:
1310
build-and-push-image:
1411
runs-on: ubuntu-latest
15-
1612
permissions:
1713
contents: read
1814
packages: write
1915
attestations: write
2016
id-token: write
21-
2217
steps:
2318
- name: Checkout repository
2419
uses: actions/checkout@v5
@@ -36,12 +31,16 @@ jobs:
3631
with:
3732
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3833

34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v3
36+
3937
- name: Build and push Docker image
4038
id: push
4139
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
4240
with:
4341
context: ./code-generator
4442
push: true
43+
platforms: linux/amd64,linux/arm64
4544
tags: ${{ steps.meta.outputs.tags }}
4645
labels: ${{ steps.meta.outputs.labels }}
4746

@@ -50,4 +49,4 @@ jobs:
5049
with:
5150
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5251
subject-digest: ${{ steps.push.outputs.digest }}
53-
push-to-registry: true
52+
push-to-registry: true

0 commit comments

Comments
 (0)