Skip to content

Commit

Permalink
properly get branch name (#2970)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg authored Apr 7, 2022
1 parent 5c09b8f commit b6fa6c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fetch-depth: 0
- name: find branch name
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
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
Expand All @@ -51,12 +51,12 @@ jobs:
- name: show system environs
if: github.event_name == 'push'
run: ./ci/helpers/show_system_versions.bash
- if: contains(env.BRANCH_NAME, 'master')
- if: contains(env.BRANCH_NAME, 'remotes/origin/master')
env:
FROM_TAG_PREFIX: staging-github
name: deploy
run: ./ci/deploy/dockerhub-tag-version.bash
- if: contains(env.BRANCH_NAME, 'hotfix_v')
- if: contains(env.BRANCH_NAME, 'remotes/origin/hotfix_v')
env:
FROM_TAG_PREFIX: hotfix-github
name: deploy from hotfix image
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
fetch-depth: 0
- name: find branch name
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
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
Expand All @@ -50,12 +50,12 @@ jobs:
- name: show system environs
if: github.event_name == 'push'
run: ./ci/helpers/show_system_versions.bash
- if: contains(env.BRANCH_NAME, 'master')
- if: contains(env.BRANCH_NAME, 'remotes/origin/master')
env:
FROM_TAG_PREFIX: master-github
name: deploy from master to staging
run: ./ci/deploy/dockerhub-tag-version.bash
- if: contains(env.BRANCH_NAME, 'hotfix_staging_')
- if: contains(env.BRANCH_NAME, 'remotes/origin/hotfix_staging_')
env:
FROM_TAG_PREFIX: hotfix-staging-github
name: deploy from hotfix staging to staging
Expand Down

0 comments on commit b6fa6c2

Please sign in to comment.