File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 11name : Build and Push Docker Image
22on :
3- release :
4- types : [published]
3+ push :
4+ tags :
5+ - ' *.*.*'
6+ workflow_dispatch :
7+ inputs :
8+ version :
9+ description : ' The version tag to build (e.g., v1.2.3)'
10+ required : true
511
612jobs :
713 build-and-push :
1420 steps :
1521 - name : Checkout repository
1622 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
23+ with :
24+ # On workflow_dispatch, checkout the tag passed in. On a tag push, checkout the tag from the event.
25+ ref : ${{ github.event.inputs.version || github.ref }}
1726
1827 - name : Log in to GitHub Container Registry
1928 uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
2231 username : ${{ github.actor }}
2332 password : ${{ secrets.GITHUB_TOKEN }}
2433
25- - name : Extract version from tag
34+ - name : Set version
2635 id : version
27- run : echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
36+ run : echo "VERSION=${{ github.event.inputs.version || github. ref_name }}" >> $GITHUB_ENV
2837
2938 - name : Convert repository name to lowercase
3039 id : repo
Original file line number Diff line number Diff line change 2424 with :
2525 persist-credentials : false
2626 - name : Semantic Release
27+ id : semantic
2728 uses : cycjimmy/semantic-release-action@9cc899c47e6841430bbaedb43de1560a568dfd16 # v5.0.0
2829 with :
2930 tag_format : ${version}
3839 conventional-changelog-conventionalcommits
3940 env :
4041 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42+ - name : Trigger Docker Build
43+ if : steps.semantic.outputs.new_release_published == 'true'
44+ uses : benc-uk/workflow-dispatch@v1
45+ with :
46+ workflow : Build and Push Docker Image
47+ token : ${{ secrets.GITHUB_TOKEN }}
48+ inputs : >
49+ {
50+ "version": "${{ steps.semantic.outputs.new_release_git_tag }}"
51+ }
You can’t perform that action at this time.
0 commit comments