Use variable for tag.

This commit is contained in:
Buster "Silver Eagle" Neece 2021-02-11 18:43:51 -06:00
parent 54661d0ad3
commit a7aadb8dc5
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
1 changed files with 15 additions and 12 deletions

View File

@ -28,8 +28,6 @@ jobs :
run : |
git gc --prune=now --aggressive
- uses : nelonoel/branch-name@v1.0.1
- name : Set up Docker Buildx
uses : docker/setup-buildx-action@v1
@ -120,20 +118,25 @@ jobs :
run : |
cat tests/_output/*
- name : Publish to Docker Hub (Main Branch)
if : env.BRANCH_NAME == 'main' && (github.event_name == 'push' || github.event_name == 'schedule')
uses : docker/build-push-action@v2
with :
push : true
tags : azuracast/azuracast_web_v2:latest
cache-from : type=local,src=/tmp/.buildx-cache
cache-to : type=local,dest=/tmp/.buildx-cache
- name : Get Branch Name
uses : nelonoel/branch-name@v1.0.1
if : github.event_name == 'push' || github.event_name == 'schedule'
- name : Determine Tag Name
if : github.event_name == 'push' || github.event_name == 'schedule'
id : tag
run : |
if [ $BRANCH_NAME == 'main' ]; then
echo "::set-output name=TAG::azuracast/azuracast_web_v2:latest"
else
echo "::set-output name=TAG::azuracast/azuracast_web_v2:${BRANCH_NAME}"
fi
- name : Publish to Docker Hub (Main Branch)
if : env.BRANCH_NAME != 'main' && (github.event_name == 'push' || github.event_name == 'schedule')
if : github.event_name == 'push' || github.event_name == 'schedule'
uses : docker/build-push-action@v2
with :
push : true
tags : azuracast/azuracast_web_v2:${{ env.BRANCH_NAME }}
tags : ${{ steps.tag.outputs.TAG }}
cache-from : type=local,src=/tmp/.buildx-cache
cache-to : type=local,dest=/tmp/.buildx-cache