@@ -17,43 +17,30 @@ jobs:
1717 steps :
1818 - uses : actions/checkout@v5
1919
20- - name : Fetch version
21- id : version
22- run : |
23- export LAST_TAGGED_COMMIT=$(git rev-list --tags --max-count=1)
24- export LAST_TAG=$(git describe --tags $LAST_TAGGED_COMMIT)
25- echo "version=${LAST_TAG#v}" >> $GITHUB_OUTPUT
26-
27- - name : Set up QEMU
28- uses : docker/setup-qemu-action@v3
29-
30- - name : Set up Docker Buildx
31- uses : docker/setup-buildx-action@v3
20+ - uses : docker/metadata-action@v5
21+ id : meta
3222 with :
33- platforms : linux/amd64,linux/arm64,linux/arm64/v8
34-
35- - name : Sign in to GitHub Container Registry
36- uses : docker/login-action@v3
23+ images : ghcr.io/${{ github.repository }}
24+ flavor : |
25+ latest=true
26+ tags : |
27+ type=semver,pattern={{version}}
28+ type=semver,pattern={{major}}.{{minor}}
29+ type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
30+ - uses : docker/setup-qemu-action@v3
31+ - uses : docker/setup-buildx-action@v3
32+ - uses : docker/login-action@v3
3733 with :
3834 registry : ghcr.io
3935 username : ${{ github.repository_owner }}
4036 password : ${{ secrets.GITHUB_TOKEN }}
41-
42- - name : Create image tags
43- id : image_tag
44- run : |
45- echo "tag_latest=ghcr.io/${{ github.repository }}:latest" >> $GITHUB_OUTPUT
46- echo "tag=ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT
47-
48- - name : Build and Push
49- uses : docker/build-push-action@v6
37+ - uses : docker/build-push-action@v6
5038 with :
5139 context : ./
5240 file : ./apps/stage-web/Dockerfile
53- push : true
5441 platforms : linux/amd64,linux/arm64,linux/arm64/v8
5542 cache-from : type=gha
5643 cache-to : type=gha,mode=max
57- tags : |
58- ${{ steps.image_tag .outputs.tag_latest }}
59- ${{ steps.image_tag .outputs.tag }}
44+ push : true
45+ tags : ${{ steps.meta .outputs.tags }}
46+ labels : ${{ steps.meta .outputs.labels }}
0 commit comments