Skip to content

Commit 837e3be

Browse files
committed
Add improved workflow for pushing Docker images
1 parent 9b016e8 commit 837e3be

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/docker-push.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ jobs:
3737
username: ${{ github.actor }}
3838
password: ${{ secrets.GITHUB_TOKEN }}
3939

40+
- name: Checkout the latest tag
41+
run: |
42+
rev=$(git rev-list --tags --max-count=1)
43+
tag=$(git describe --tags "$rev")
44+
45+
if [[ -z "$tag" ]] ; then
46+
echo "::error::Can't find the latest tag"
47+
exit 1
48+
fi
49+
50+
echo -e "\033[34mRev:\033[0m $rev"
51+
echo -e "\033[34mTag:\033[0m $tag"
52+
53+
git checkout "$tag"
54+
4055
- name: Prepare metadata for build
4156
id: metadata
4257
run: |

0 commit comments

Comments
 (0)