2020 with :
2121 fetch-depth : 0
2222
23- - name : Set up Go
24- uses : actions/setup-go@master
25- with :
26- go-version : 1.21.x
23+ - name : Set up QEMU
24+ uses : docker/setup-qemu-action@v3
2725
2826 - name : Set up Docker Buildx
2927 uses : docker/setup-buildx-action@v3
@@ -34,23 +32,33 @@ jobs:
3432 username : ${{ secrets.DOCKERHUB_USERNAME }}
3533 password : ${{ secrets.DOCKERHUB_TOKEN }}
3634
37- - name : Prepare
38- id : prepare
35+ - name : Login to GitHub Container Registry
36+ uses : docker/login-action@v3
37+ with :
38+ registry : ghcr.io
39+ username : ${{ github.repository_owner }}
40+ password : ${{ secrets.GITHUB_TOKEN }}
41+
42+ - name : Fetch latest tag
43+ id : tag
3944 run : echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
4045
41- - name : Release
46+ - name : Build and push
47+ uses : docker/build-push-action@v6
48+ with :
49+ platforms : linux/amd64,linux/arm64
50+ push : true
51+ tags : |
52+ mgsousa/json-stats-exporter:${{ steps.tag.outputs.tag_name }}
53+ mgsousa/json-stats-exporter:latest
54+ ghcr.io/mgsousa/json-stats-exporter:${{ steps.tag.outputs.tag_name }}
55+ ghcr.io/mgsousa/json-stats-exporter:latest
56+
57+ - name : Release assets
4258 uses : goreleaser/goreleaser-action@v6
4359 with :
4460 version : latest
4561 args : release --clean --timeout=5m
4662 env :
4763 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48- VERSION : ${{ steps.prepare.outputs.tag_name }}
49-
50- - name : Build and push
51- uses : docker/build-push-action@v6
52- with :
53- context : .
54- file : Dockerfile.release
55- push : true
56- tags : mgsousa/json-stats-exporter:${{ steps.prepare.outputs.tag_name }},mgsousa/json-stats-exporter:latest
64+ VERSION : ${{ steps.tag.outputs.tag_name }}
0 commit comments