From: Cooper Lees Date: Wed, 28 Apr 2021 03:10:44 +0000 (-0700) Subject: Add automatic version tagging to Docker CI Pushes (#2132) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/04fd4432f6c6007e419d7174930569a75ea60fed?ds=sidebyside Add automatic version tagging to Docker CI Pushes (#2132) * Add automatic version tagging to Docker Uploads - If the git comment has a tag, set that on the docker images pushed - If we don't have a tag, we just set `latest_non_release` * Add trigger on release creation too * Make prettier happy omn docker.yml --- diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0939013..7eaf233 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,6 +4,8 @@ on: push: branches: - "master" + release: + types: created jobs: docker: @@ -24,13 +26,18 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Check + set version tag + run: + echo "GIT_TAG=$(git describe --candidates=0 --tags 2> /dev/null || echo + latest_non_release)" >> $GITHUB_ENV + - name: Build and push uses: docker/build-push-action@v2 with: context: . platforms: linux/amd64,linux/arm64 push: true - tags: pyfound/black:latest + tags: pyfound/black:latest,pyfound/black:${{ env.GIT_TAG }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }}