push-to-ghcr
push-to-ghcr copied to clipboard
Possibility to build images for pushed tags
Hi,
this action is very useful! Lately (given some github specialities about Releases and CI, which in turn prevent this from building tagged containers for Julia packages released by the official TagBot tooling) we decided that we'd like to build docker images for pushed tags instead of the published releases.
Would it be possible to have support for tags, basically in the same way as for releases?
I assume that for supporting tags, we'd only need to make the condition here (https://github.com/macbre/push-to-ghcr/blob/master/action.yml#L73) a little more generous towards the tag pushing, but I'm no github actions expert so maybe there's a hidden problem.
Thanks for any hints/comments here. If I get some free time I'll try a PR.
Best! -mk
I assume that for supporting tags, we'd only need to make the condition here (https://github.com/macbre/push-to-ghcr/blob/master/action.yml#L73) a little more generous towards the tag pushing, but I'm no github actions expert so maybe there's a hidden problem.
Or you can just hook to the "tag pushed" event in your GitHub Action and pass the desired container tag via the image_tag action input. Something along:
on:
# https://stackoverflow.com/a/63646054/5446110
push:
tags:
- '*'
ah ok, so I assume I would simply push in a "dynamic" image_tag, as in
image_tag: ${{ github.ref }}
...plusminus a bit of iffage around to make sure weird refs don't reach this. Does that sound right?
Does that sound right?
Correct :-) Closing then.