File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 33on :
44 push :
55 branches : ["main"]
6+ tags :
7+ - " v*.*.*"
68 pull_request :
79 branches : ["main"]
810
3436 name : Build & Push Docker Image
3537 runs-on : ubuntu-latest
3638 needs : test-and-lint
37- if : github.ref == 'refs/heads/main '
39+ if : github.ref_type == 'tag '
3840 permissions :
3941 contents : read
4042 packages : write
5860 with :
5961 context : .
6062 push : true
61- tags : ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
63+ tags : |
64+ ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
65+ ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.ref_name }}
66+
67+ release :
68+ name : Create GitHub Release
69+ runs-on : ubuntu-latest
70+ needs : build-and-push
71+ if : github.ref_type == 'tag'
72+ permissions :
73+ contents : write
74+
75+ steps :
76+ - name : Checkout code
77+ uses : actions/checkout@v4
78+
79+ - name : Create Release
80+ uses : softprops/action-gh-release@v2
81+ with :
82+ tag_name : ${{ github.ref_name }}
83+ name : Release ${{ github.ref_name }}
84+ env :
85+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments