-
Notifications
You must be signed in to change notification settings - Fork 40
Add metadata-action so labels are generated #426
base: main
Are you sure you want to change the base?
Conversation
kegsay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know enough about this which is why it's taken me a while to look into this.
I'll need you to walk me through your changes and justify them. Thanks.
| platforms: ${{ env.PLATFORMS }} | ||
| push: true | ||
| tags: | | ||
| ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem to be losing the :latest tag..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the latest tag is no longer specified by docker/build-push-action@v4, but a list of tags (in this case I think only one) is created by docker/metadata-action@v5
See
sliding-sync/.github/workflows/docker.yml
Line 46 in 8bcd28b
| ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) && 'type=raw,value=latest' }} |
It'll create main on main branch, latest on release, and then always a sha specific tag
| uses: docker/metadata-action@v5 | ||
| with: | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem to lose the caching..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this diff is just because i merged them into the one docker/build-push-action@v4
Though that being said, i think the if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') should be removed so its always pushing an email? or did you only want images pushed for releases? its been a few weeks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No wait yes, the if: should be removed so it always builds the image, but maybe the push: true could be made into a conditional so only pushes the result sometimes?
Yea thats cool, i'm only just starting to learn about labels because of my k8s lab. I think the diff is making it more confusing than it should be too. |
Signed-off-by: Gavin Mogan <[email protected]>
|
Fixed a typo, it now runs Example version - v0.0.1 (I have a bug cause one tag is "false") |
* any branch this workflow runs for will get a tag * any pr this workflow runs for will get a tag * github tags will get a tag (semver pattern raw) * a sha tag will be created * latest tag will be created if its a tag
|
|

I use renovate to make sure my deployed apps are up to date. (halkeye/home-k8s#116) and according to the documentation if the source docker label is set, it'll actually pull in the release notes.
I checked the latest release, and it doesn't seem to have the labels (or any labels) set, so using the pre-existing github action should populate all the nice metadata.
regctl image config --format '{{ jsonPretty .Config.Labels }}' ghcr.io/matrix-org/sliding-sync
null
Pull Request Checklist