diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-11-26 16:32:39 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-11-28 11:12:59 -0800 |
commit | 467cae065141e412c4a8e36dadc8b009fe6aee96 (patch) | |
tree | e8b486f32d97608e3effef65461a7dd045edbdb2 /.github/workflows | |
parent | 9147e83b8cec585d9d110ab8d604c6613d7c6357 (diff) | |
download | subsurface-467cae065141e412c4a8e36dadc8b009fe6aee96.tar.gz |
GitHub Actions: add branch name to docker image name
Unless we're on master.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/android-dockerimage.yml | 5 | ||||
-rw-r--r-- | .github/workflows/linux-dockerimage.yml | 5 | ||||
-rw-r--r-- | .github/workflows/mxe-dockerimage-stage1.yml | 5 | ||||
-rw-r--r-- | .github/workflows/mxe-dockerimage-stage2.yml | 5 |
4 files changed, 16 insertions, 4 deletions
diff --git a/.github/workflows/android-dockerimage.yml b/.github/workflows/android-dockerimage.yml index c8f594109..d67831e43 100644 --- a/.github/workflows/android-dockerimage.yml +++ b/.github/workflows/android-dockerimage.yml @@ -25,7 +25,10 @@ jobs: - name: set env run: | 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 uses: elgohr/Publish-Docker-Github-Action@master diff --git a/.github/workflows/linux-dockerimage.yml b/.github/workflows/linux-dockerimage.yml index 9dd0106c8..e978132a8 100644 --- a/.github/workflows/linux-dockerimage.yml +++ b/.github/workflows/linux-dockerimage.yml @@ -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 diff --git a/.github/workflows/mxe-dockerimage-stage1.yml b/.github/workflows/mxe-dockerimage-stage1.yml index e3d2ace7c..0f6743d5f 100644 --- a/.github/workflows/mxe-dockerimage-stage1.yml +++ b/.github/workflows/mxe-dockerimage-stage1.yml @@ -26,7 +26,10 @@ jobs: run: | v=${{ env.VERSION }} 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 uses: elgohr/Publish-Docker-Github-Action@master diff --git a/.github/workflows/mxe-dockerimage-stage2.yml b/.github/workflows/mxe-dockerimage-stage2.yml index 5554b197c..3d35aa2f9 100644 --- a/.github/workflows/mxe-dockerimage-stage2.yml +++ b/.github/workflows/mxe-dockerimage-stage2.yml @@ -21,8 +21,11 @@ jobs: run: | v=${{ github.event.action }} 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=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 uses: elgohr/Publish-Docker-Github-Action@master |