generated from kbase/kbase-template
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (37 loc) · 1.28 KB
/
prod_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
name: Publish Release Image
'on':
release:
branches:
- main
- master
types:
- published
jobs:
docker_build:
runs-on: ubuntu-latest
steps:
- name: Check Tag
id: check-tag
run: |-
if [[ ${{ github.ref_name }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=match::true
fi
- name: Report SemVer Check
if: steps.check-tag.outputs.match != 'true'
run: echo "Release version must follow semantic naming (e.g. 1.0.2)"; exit 1
- name: Check Source Branch
if: github.event.release.target_commitish != 'master' && github.event.release.target_commitish != 'main'
run: echo "Releases must be built from master/main branch"; exit 1
- name: Check out GitHub Repo
with:
ref: "${{ github.event.pull_request.head.sha }}"
uses: actions/checkout@v2
- name: Build and Push to Packages
env:
PR: "${{ github.event.pull_request.number }}"
SHA: "${{ github.event.pull_request.head.sha }}"
VER: "${{ github.event.release.tag_name }}"
DOCKER_ACTOR: "${{ secrets.GHCR_USERNAME }}"
DOCKER_TOKEN: "${{ secrets.GHCR_TOKEN }}"
run: "curl https://raw.githubusercontent.com/kbase/.github/main/workflow-templates/scripts/prod_release.sh | bash"