Skip to content

Commit 7d18db4

Browse files
authored
CI: use ref_type for checks if branch or tag (#650)
1 parent 48f69bb commit 7d18db4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ jobs:
332332
docker push scalableminds/webknossos-cuber:$GITHUB_SHA
333333
334334
- name: Push docker images (for tag)
335-
if: startsWith(github.event.ref, 'refs/tags')
335+
if: github.ref_type == 'tag'
336336
run: |
337337
CI_TAG=$(git describe --tags)
338338
docker tag \
@@ -341,7 +341,7 @@ jobs:
341341
docker push scalableminds/webknossos-cuber:$CI_TAG
342342
343343
- name: Push docker images (for branch)
344-
if: startsWith(github.event.ref, 'refs/heads')
344+
if: github.ref_type == 'branch'
345345
run: |
346346
CI_BRANCH=${GITHUB_REF##*/}
347347
NORMALIZED_CI_BRANCH=${CI_BRANCH//[\/-]/_}
@@ -386,7 +386,7 @@ jobs:
386386
docs/generate.sh --persist
387387
388388
- name: Push docs (for branch)
389-
if: startsWith(github.event.ref, 'refs/heads')
389+
if: github.ref_type == 'branch'
390390
env:
391391
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
392392
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -397,7 +397,7 @@ jobs:
397397
aws s3 sync --acl public-read docs/out s3://static.webknossos.org/docs/${NORMALIZED_CI_BRANCH}
398398
399399
- name: Push docs (for tag)
400-
if: startsWith(github.event.ref, 'refs/tags')
400+
if: github.ref_type == 'tag'
401401
env:
402402
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
403403
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -423,7 +423,7 @@ jobs:
423423
always() &&
424424
!contains(needs.*.result, 'failure') &&
425425
!contains(needs.*.result, 'cancelled') &&
426-
startsWith(github.event.ref, 'refs/tags') &&
426+
github.ref_type == 'tag' &&
427427
!github.event.pull_request.head.repo.fork
428428
runs-on: ubuntu-latest
429429

0 commit comments

Comments
 (0)