Skip to content

Commit fc721ff

Browse files
authored
Merge pull request #65 from roidelapluie/roidelapluie/fixlatest
Only push 'latest' Docker tags for the most recent stable release
2 parents 74b5554 + 42c8f9a commit fc721ff

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

actions/publish_release_images/action.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,19 @@ runs:
4646
make docker-publish DOCKER_IMAGE_TAG="$current_tag" DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
4747
make docker-manifest DOCKER_IMAGE_TAG="$current_tag" DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
4848
if [[ "$current_tag" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
49-
make docker-tag-latest DOCKER_IMAGE_TAG="$current_tag" DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
50-
make docker-publish DOCKER_IMAGE_TAG="latest" DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
51-
make docker-manifest DOCKER_IMAGE_TAG="latest" DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
49+
# Get the latest stable release tag (excluding pre-releases)
50+
latest_tag=$(git tag -l 'v*' | grep -P '^v\d+\.\d+\.\d+$' | sort -V -r | head -n1)
51+
echo "Current tag: $current_tag"
52+
echo "Latest stable tag: $latest_tag"
53+
54+
# Only push "latest" tags if this is the latest stable release
55+
if [[ "${current_tag}" == "${latest_tag}" ]]; then
56+
echo "This is the latest stable release, pushing 'latest' tags"
57+
make docker-tag-latest DOCKER_IMAGE_TAG="$current_tag" DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
58+
make docker-publish DOCKER_IMAGE_TAG="latest" DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
59+
make docker-manifest DOCKER_IMAGE_TAG="latest" DOCKER_REPO=${{ inputs.registry }}/${{ inputs.organization }}
60+
else
61+
echo "Skipping 'latest' tags - $current_tag is not the latest stable release"
62+
fi
5263
fi
5364
shell: bash

0 commit comments

Comments
 (0)