66 branches :
77 - main
88 - develop
9- - " feature/**"
10- - " hotfix/**"
9+ - ' feature/**'
10+ - ' hotfix/**'
1111 tags :
12- - " v*.*.*"
12+ - ' v*.*.*'
1313 pull_request :
1414 branches :
1515 - main
2020 IMAGE_NAME : ${{ github.repository }}
2121
2222jobs :
23- # lint:
24- # name: Lint Dockerfile
25- # runs-on: ubuntu-latest
26- # steps:
27- # - name: Checkout code
28- # uses: actions/checkout@v4
23+ lint :
24+ name : Lint Dockerfile
25+ runs-on : ubuntu-latest
26+ steps :
27+ - name : Checkout code
28+ uses : actions/checkout@v4
2929
30- # - name: Lint Dockerfile
31- # uses: hadolint/[email protected] 32- # with:
33- # dockerfile: Dockerfile
30+ - name : Lint Dockerfile
31+ 32+ with :
33+ dockerfile : Dockerfile
3434
3535 build-and-push :
3636 name : Build and Push Docker image
37- # needs: lint
37+ needs : lint
3838 runs-on : ubuntu-latest
3939 permissions :
4040 contents : read
4444 - name : Checkout code
4545 uses : actions/checkout@v4
4646
47+ - name : Extract short SHA
48+ id : vars
49+ run : echo "sha_short=$(git rev-parse --short=7 ${{ github.sha }})" >> $GITHUB_OUTPUT
50+
51+ - name : Set up QEMU
52+ uses : docker/setup-qemu-action@v3
53+
4754 - name : Set up Docker Buildx
4855 uses : docker/setup-buildx-action@v3
4956
6067 with :
6168 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6269 tags : |
63- type=sha,format=long
70+ type=raw,value=sha-${{ steps.vars.outputs.sha_short }}
6471 type=ref,event=branch
6572 type=ref,event=pr
6673 type=semver,pattern={{version}}
@@ -72,14 +79,18 @@ jobs:
7279 uses : docker/build-push-action@v5
7380 with :
7481 context : .
82+ platforms : linux/amd64,linux/arm64
7583 push : ${{ github.event_name != 'pull_request' }}
7684 tags : ${{ steps.meta.outputs.tags }}
7785 labels : ${{ steps.meta.outputs.labels }}
7886 cache-from : type=gha
7987 cache-to : type=gha,mode=max
8088
81- - name : Print image tags
89+ - name : Print image details
8290 if : github.event_name != 'pull_request'
8391 run : |
8492 echo "Published tags:"
8593 echo "${{ steps.meta.outputs.tags }}" | tr ' ' '\n'
94+ echo -e "\nPlatforms:"
95+ echo "- linux/amd64"
96+ echo "- linux/arm64"
0 commit comments