From 0c36cdf5ba080f0c5e8e925d1a446fda2fbcfc8b Mon Sep 17 00:00:00 2001 From: Dawa Ometto Date: Wed, 12 Jan 2022 11:04:12 +0100 Subject: [PATCH] Support versioned Docker builds (#1799) --- .github/workflows/docker-deploy.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml index 9c114dc5..6d7a4c2d 100644 --- a/.github/workflows/docker-deploy.yml +++ b/.github/workflows/docker-deploy.yml @@ -1,12 +1,22 @@ name: Deploy docker -on: [push] -env: - DEPLOY_NAME: gollumwiki/gollum:latest +on: + push: + branches: + - master + release: + types: [published] jobs: build: runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/master' }} steps: + - name: Set deploy name to master + if: github.ref == 'refs/heads/master' + run: | + echo "DEPLOY_NAME=gollumwiki/gollum:master" + - name: Set deploy name to release version + if: startsWith(github.ref, 'refs/tags/') + run: | + echo "DEPLOY_NAME=gollumwiki/gollum:${{ github.ref_name }}" - name: Check Out Repo uses: actions/checkout@v2 - name: Login @@ -36,4 +46,4 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file + run: echo ${{ steps.docker_build.outputs.digest }}