Skip to content

Commit e6e723b

Browse files
authored
base_ref is only available in forked repositories (#1768)
1 parent db0030e commit e6e723b

File tree

2 files changed

+15
-42
lines changed

2 files changed

+15
-42
lines changed

.github/workflows/ci-hotfix.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/ci-release.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ env:
1313

1414
jobs:
1515
deploy:
16-
# if: github.event.base_ref == 'refs/heads/master'
17-
# only run on staging branch
1816
name: deploy release
1917
runs-on: ubuntu-latest
2018
env:
21-
FROM_TAG_PREFIX: staging-github
2219
TO_TAG_PREFIX: release-github
2320
steps:
2421
- uses: actions/checkout@v2
25-
- name: show environment
26-
run: env
22+
with:
23+
fetch-depth: 0
24+
- name: set target variable
25+
run: |
26+
target=$(git name-rev --refs="refs/remotes/origin/*" --name-only ${GITHUB_SHA})
27+
echo ::set-env name=TARGET::${target}
2728
- name: setup docker
2829
run: |
2930
sudo ./ci/github/helpers/setup_docker_compose.bash
@@ -34,5 +35,13 @@ jobs:
3435
run: echo ::set-env name=OWNER::${GITHUB_REPOSITORY%/*}
3536
- name: set git tag
3637
run: echo ::set-env name=GIT_TAG::${GITHUB_REF##*/}
37-
- name: deploy
38+
- if: env.TARGET == 'remotes/origin/master'
39+
env:
40+
FROM_TAG_PREFIX: staging-github
41+
name: deploy
42+
run: ./ci/deploy/dockerhub-tag-version.bash
43+
- if: contains(env.TARGET, 'remotes/origin/hotfix_v')
44+
env:
45+
FROM_TAG_PREFIX: hotfix-github
46+
name: deploy from hotfix image
3847
run: ./ci/deploy/dockerhub-tag-version.bash

0 commit comments

Comments
 (0)