GitHub Actions: add branch name to docker image name

Unless we're on master.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-11-26 16:32:39 -08:00
parent 9147e83b8c
commit 467cae0651
4 changed files with 16 additions and 4 deletions

View file

@ -23,7 +23,10 @@ jobs:
- name: set env
run: |
v=${{ env.VERSION }}
echo "::set-env name=NAME::subsurface/trusty-qt512:${v}"
b=${{ github.ref }} # -BRANCH suffix, unless the branch is master
b=${b/refs\/heads\//}
if [ $b = "master" ] ; then b="" ; else b="-$b" ; fi
echo "::set-env name=NAME::subsurface/trusty-qt512${b}:${v}"
- name: Build and Publish Linux Docker image to Dockerhub
uses: elgohr/Publish-Docker-Github-Action@master