File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed
Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change 44 tags :
55 - v*
66
7+ permissions :
8+ contents : read
9+ packages : write
10+
711jobs :
812 publish :
913 runs-on : ubuntu-latest
@@ -13,12 +17,18 @@ jobs:
1317 with :
1418 go-version : " ~1.24"
1519 - name : build
16- run : |
17- go build .
18- - name : release
19- run : |
20- echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USER }}" --password-stdin
21- docker build . --tag ghcr.io/${{github.repository}}:${GITHUB_REF#refs/tags/}
22- docker tag ghcr.io/${{github.repository}}:${GITHUB_REF#refs/tags/} ghcr.io/${{github.repository}}:latest
23- docker push ghcr.io/${{github.repository}}:${GITHUB_REF#refs/tags/}
24- docker push ghcr.io/${{github.repository}}:latest
20+ run : go build -v .
21+ - name : Login to GitHub Container Registry
22+ uses : docker/login-action@v3
23+ with :
24+ registry : ghcr.io
25+ username : ${{ github.actor }}
26+ password : ${{ secrets.GITHUB_TOKEN }}
27+ - name : Build and push Docker image
28+ uses : docker/build-push-action@v5
29+ with :
30+ context : .
31+ push : true
32+ tags : |
33+ ghcr.io/${{ github.repository }}:${GITHUB_REF#refs/tags/}
34+ ghcr.io/${{ github.repository }}:latest
You can’t perform that action at this time.
0 commit comments