From f4593052f20a334a6c5fece52632835f94e86e7e Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Fri, 16 Feb 2024 20:30:08 +0100 Subject: [PATCH] feat(workflow): tag release to latest --- .github/workflows/docker.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ffc5ccf..8f9205b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -32,12 +32,16 @@ jobs: [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - [ "$VERSION" == "master" ] && VERSION=latest echo IMAGE_ID=$IMAGE_ID echo VERSION=$VERSION docker tag $IMAGE_NAME $IMAGE_ID:$VERSION docker push $IMAGE_ID:$VERSION + if [[ $VERSION =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + docker tag $IMAGE_ID:$VERSION $IMAGE_ID:latest + docker push $IMAGE_ID:$VERSION + fi + # build repoUrl # change all uppercase characters to lowercase # strip git ref prefix from version