-
Notifications
You must be signed in to change notification settings - Fork 27
52 lines (48 loc) · 1.66 KB
/
ci-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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Github-CI-Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
env:
# secrets can be set in settings/secrets on github
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
name: deploy release
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ["3.11"]
os: [ubuntu-22.04]
fail-fast: false
env:
TO_TAG_PREFIX: release-github
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: find branch name
shell: bash
run: echo "BRANCH_NAME=$(git name-rev --refs="refs/remotes/origin/master" --refs="refs/remotes/origin/hotfix_v*" --refs="refs/remotes/origin/hotfix_staging_*" --name-only ${GITHUB_SHA})" >> $GITHUB_ENV
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: set owner variable
run: echo "OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV
- name: set git tag
run: echo "GIT_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: show system environs
if: github.event_name == 'push'
run: ./ci/helpers/show_system_versions.bash
- name: source image is staging
run: echo "FROM_TAG_PREFIX=staging-github" >> $GITHUB_ENV
- if: contains(env.BRANCH_NAME, 'remotes/origin/hotfix_v')
name: source image is hotfix (instead of staging)
run: echo "FROM_TAG_PREFIX=hotfix-github" >> $GITHUB_ENV
- name: deploy
run: ./ci/deploy/dockerhub-tag-version.bash