feat: Add semantic version tags to Docker releases #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add semantic version tags to Docker images
Problem
Currently, Docker images are only tagged with commit SHAs (e.g.,
9e426479499f23a56d596aa9f8e3188924b82947), making it difficult to:Solution
Enhance the Docker build workflow to automatically tag images with semantic versions when Git tags are pushed.
Changes
docker/metadata-actionv1.2.0,1.2,1,latestExample
When you create a release
v1.2.0, the following Docker tags will be created:robertlestak/cert-manager-sync:v1.2.0robertlestak/cert-manager-sync:1.2robertlestak/cert-manager-sync:1robertlestak/cert-manager-sync:9e426479499f23a56d596aa9f8e3188924b82947(existing)robertlestak/cert-manager-sync:latest(on main branch)Benefits
image: cert-manager-sync:v1.2.0)Testing
Tested locally with:
docker buildx build --platform linux/amd64,linux/arm64 \ -t robertlestak/cert-manager-sync:v1.2.0 \ -t robertlestak/cert-manager-sync:1.2 \ -t robertlestak/cert-manager-sync:1 \ .Migration
No breaking changes - existing commit SHA tags will continue to work.