File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 77 branches : [ main ]
88 release :
99 types : [ published ]
10+ workflow_dispatch :
11+ inputs :
12+ manual_push :
13+ description : ' Set to "yes" to push tag :test image to GHCR for testing before merging to main'
14+ required : false
15+ default : ' no'
1016
1117jobs :
1218
3440
3541 push-to-ghcr :
3642 runs-on : ubuntu-latest
37- # if: github.ref == 'refs/heads/main'
43+ # Run if on main branch, or if manual_push is yes from workflow_dispatch
44+ if : >-
45+ (github.ref == 'refs/heads/main') ||
46+ (github.event_name == 'workflow_dispatch' && github.event.inputs.manual_push == 'yes')
3847 needs : build-test
3948 permissions :
4049 contents : read
@@ -65,12 +74,10 @@ jobs:
6574
6675 - name : Set IMAGE_TAG for build-test
6776 run : |
68- if [ "${{ github.event_name }}" = "pull_request " ]; then
77+ if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.manual_push }}" = "yes " ]; then
6978 echo "IMAGE_TAG=test" >> $GITHUB_ENV
7079 elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
7180 echo "IMAGE_TAG=latest" >> $GITHUB_ENV
72- else
73- echo "IMAGE_TAG=${GITHUB_SHA::8}" >> $GITHUB_ENV
7481 fi
7582
7683 - name : Extract metadata for Docker
You can’t perform that action at this time.
0 commit comments