mr-smithers-excellent / docker-build-push

Docker Build & Push GitHub Action
MIT License
280 stars 62 forks source link

How to push latest tag only upon releases #238

Closed f18m closed 3 months ago

f18m commented 4 months ago

Hi @mr-smithers-excellent , I noticed that, according to the docs: https://github.com/marketplace/actions/docker-build-push-action#auto-tagging-with-gitops

the 'latest' tag is pushed only when addLatest=true. However if I set that attribute, then even feature branches will override the latest tag of e.g. my released version "1.0.0". My need would be to push the "latest" tag only when releasing new versions (i.e. when placing a git tag). How can I achieve that? Thanks!

mr-smithers-excellent commented 3 months ago

That sort of tagging is not supported through the action. You would have to run a step before this action and set the tag as either an environment variable or output, then set tags on this action accordingly.