Skip to content

Commit

Permalink
Apply a docker tag discriminant
Browse files Browse the repository at this point in the history
  • Loading branch information
miraclx committed Sep 4, 2022
1 parent 0b0aac7 commit d27c414
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ jobs:
HEAD_SHA=$( echo ${{ github.event.pull_request.head.sha || github.sha }} | head -c7 )
echo "::set-output name=head_sha::$HEAD_SHA"
- name: Should Push Docker Branch?
id: push-branch
- name: Get Docker Tag
id: get-docker-tag-spec
run: |
if [[ "${{ github.event_name }}" == 'push' ]]; then
echo "::set-output name=branch::type=ref,event=branch"
echo "::set-output name=spec::type=ref,event=branch"
else if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
echo "::set-output name=spec::type=ref,event=pr"
fi
- name: Extract Metadata (tags, labels) For Docker
Expand All @@ -140,12 +142,12 @@ jobs:
with:
images: freyrcli/freyrjs-git
tags: |
type=ref,event=pr
${{ steps.push-branch.outputs.branch }}
${{ steps.get-docker-tag-spec.outputs.spec }}
type=raw,value=${{ steps.get-shas.outputs.head_sha }}
- name: Extract Tags
id: get-docker-tag
if: github.event_name == 'pull_request'
run: |
PR_TAG=$( echo "${{ steps.docker-meta.outputs.tags }}" | sed 's/freyrcli\/freyrjs-git://g' )
echo "::set-output name=tag::$PR_TAG"
Expand Down

0 comments on commit d27c414

Please sign in to comment.