Skip to content

Commit 8d2210c

Browse files
authored
1 parent 5f35012 commit 8d2210c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/docker-publish.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ defaults:
1919

2020
concurrency:
2121
# this expression gives us the name of the deployment environment. It works like a ternary operation (see https://github.com/actions/runner/issues/409#issuecomment-727565588)
22-
group: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}
22+
group: ${{ github.ref_type != 'tag' && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}
2323
cancel-in-progress: true
2424

2525
jobs:
2626
test:
2727
uses: ./.github/workflows/run-tests.yml
28-
if: startsWith(github.ref, 'refs/tags/')
28+
if: github.ref_type == 'tag'
2929

3030
deploy:
3131
needs: test
3232
# !cancelled() is needed because if the whole workflow was cancelled, we don't want this job to run.
33-
# (!startsWith(github.ref, 'refs/tags/') || needs.test.result == 'success') is needed because if `test` did run, we only want this to run if `test` succeeded.
34-
if: (!cancelled() && (!startsWith(github.ref, 'refs/tags/') || needs.test.result == 'success'))
33+
# (github.ref_type != 'tag' || needs.test.result == 'success') is needed because if `test` did run, we only want this to run if `test` succeeded.
34+
if: (!cancelled() && (github.ref_type != 'tag' || needs.test.result == 'success'))
3535
runs-on: ubuntu-latest
36-
environment: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}
36+
environment: ${{ github.ref_type != 'tag' && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}
3737

3838
steps:
3939
- name: Checkout
@@ -88,6 +88,6 @@ jobs:
8888
file: Dockerfile
8989
push: true
9090
tags: |
91-
ghcr.io/${{ github.repository }}:${{ !startsWith(github.ref, 'refs/tags/') && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}
91+
ghcr.io/${{ github.repository }}:${{ github.ref_type != 'tag' && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}
9292
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
9393
ghcr.io/${{ github.repository }}:${{ github.sha }}

0 commit comments

Comments
 (0)