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

@ -25,7 +25,10 @@ jobs:
- name: set env - name: set env
run: | run: |
v=${{ env.VERSION }} v=${{ env.VERSION }}
echo "::set-env name=NAME::subsurface/android-build-container:${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/android-build-container${b}:${v}"
- name: Build and Publish Linux Docker image to Dockerhub - name: Build and Publish Linux Docker image to Dockerhub
uses: elgohr/Publish-Docker-Github-Action@master uses: elgohr/Publish-Docker-Github-Action@master

View file

@ -23,7 +23,10 @@ jobs:
- name: set env - name: set env
run: | run: |
v=${{ env.VERSION }} 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 - name: Build and Publish Linux Docker image to Dockerhub
uses: elgohr/Publish-Docker-Github-Action@master uses: elgohr/Publish-Docker-Github-Action@master

View file

@ -26,7 +26,10 @@ jobs:
run: | run: |
v=${{ env.VERSION }} v=${{ env.VERSION }}
s=".stage1" s=".stage1"
echo "::set-env name=NAME::subsurface/mxe-build-container:${v}${s}" 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/mxe-build-container${b}:${v}${s}"
- name: Build and Publish stage 1 Docker image to Dockerhub - name: Build and Publish stage 1 Docker image to Dockerhub
uses: elgohr/Publish-Docker-Github-Action@master uses: elgohr/Publish-Docker-Github-Action@master

View file

@ -21,8 +21,11 @@ jobs:
run: | run: |
v=${{ github.event.action }} v=${{ github.event.action }}
s=".stage1" s=".stage1"
b=${{ github.event.client_payload.target_branc }} # -BRANCH suffix, unless the branch is master
b=${b/refs\/heads\//}
if [ $b = "master" ] ; then b="" ; else b="-$b" ; fi
echo "::set-env name=VERSION::${v}${s}" echo "::set-env name=VERSION::${v}${s}"
echo "::set-env name=NAME::subsurface/mxe-build-container:${v}" echo "::set-env name=NAME::subsurface/mxe-build-container${b}:${v}"
- name: Build and Publish stage 2 Docker image to Dockerhub - name: Build and Publish stage 2 Docker image to Dockerhub
uses: elgohr/Publish-Docker-Github-Action@master uses: elgohr/Publish-Docker-Github-Action@master