From 837e3be4e9c0df5b2356171f2f3d744e2e715fb4 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sat, 28 May 2022 12:34:01 +0300 Subject: [PATCH] Add improved workflow for pushing Docker images --- .github/workflows/docker-push.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 6e30210..fa04ca6 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -37,6 +37,21 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout the latest tag + run: | + rev=$(git rev-list --tags --max-count=1) + tag=$(git describe --tags "$rev") + + if [[ -z "$tag" ]] ; then + echo "::error::Can't find the latest tag" + exit 1 + fi + + echo -e "\033[34mRev:\033[0m $rev" + echo -e "\033[34mTag:\033[0m $tag" + + git checkout "$tag" + - name: Prepare metadata for build id: metadata run: |