File tree Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 11---
2- name : Release - Test, Build & Push Image
2+ name : Release - Build & Push Image
33on :
44 release :
55 branches :
Original file line number Diff line number Diff line change 1+ ---
2+ name : Release2 - Build & Push Image
3+ on :
4+ release :
5+ branches :
6+ - main
7+ - master
8+ types : [ published ]
9+ jobs :
10+ check-source-branch :
11+ if : github.event.release.target_commitish != 'master' && github.event.release.target_commitish != 'main'
12+ uses : .github/workflows/reusable_validate-branch.yml
13+ with :
14+ build_branch : ' ${{ github.event.release.target_commitish }}'
15+ validate-release-tag :
16+ uses : kbase/.github/.github/workflows/reusable_validate-release-tag.yml@main
17+ with :
18+ release_tag : ' ${{ github.event.release.tag_name }}'
19+ build-push :
20+ needs : validate-release-tag
21+ uses : kbase/.github/.github/workflows/reusable_build-push.yml@main
22+ with :
23+ name : ' ${{ github.event.repository.name }}'
24+ tags : ' ${{ github.event.release.tag_name }},latest'
25+ secrets : inherit
Original file line number Diff line number Diff line change 1+ ---
2+ name : Ensure releases are build from main/master branch.
3+ on :
4+ workflow_call :
5+ inputs :
6+ build_branch :
7+ required : true
8+ type : string
9+ jobs :
10+ ensure-semver :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Validate that releases are build from main/master
14+ uses : actions/github-script@v6
15+ with :
16+ script : |
17+ const buildBranch = '${{ inputs.build_branch }}';
18+ if ((buildBranch !== 'main') && ((buildBranch !== 'master')) {
19+ core.setFailed(`Releases must be built from the main or master branch, not "${buildBranch}"`)
20+ }
You can’t perform that action at this time.
0 commit comments