-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github: Build and publish Docker image on release #12734
Conversation
012f262
to
87f1fc9
Compare
@morremeyer a question;
|
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.
@bep The GITHUB_TOKEN
that gets injected is enough, since the packages:write
permission is set in https://github.com/gohugoio/hugo/pull/12734/files#diff-113df80dfdb383808d66c98190c3f60ea45745427f926da3b04f572ff081d8a6R13-R14.
I use it in the same way in https://github.com/community-tooling/oci-images/blob/5b78318d705c60ff3fd66dca827041f98ee18c7a/.github/workflows/build.yml.
What I forgot in this PR is to remove the if
condition to log in only on tags, which should not be set here.
With the suggestions, this will now build and push for branches & PRs as defined in https://github.com/docker/metadata-action#typeref:
- For a branch, the image tag will be the branch name
- For a tag, the image tag will be the tag name
If you want, I can go through the different scenarios on my fork to verify them.
No, that's fine. I need to understand this setup myself, and a little trying-and-failing helps ... |
Feel free to ping me for anything related to the image in the future, too - I'll use the image myself, so this will be a nice way to contribute back. |
39aefa2
to
9ee683e
Compare
9ee683e
to
4b516c3
Compare
@morremeyer I had to add this commit to make the build green: 4b516c3 ... makes sense to you? I'm doing a Hugo release on either Monday or Tuesday, in which we'll see if the publishing part works ... |
That works, but we might end up with layers/images that are never published, since we build on push of changes to the Dockerfile or the workflow and then never merge these images, if it's not a tag. My suggestion in #12734 (comment) should fix that while still merging for all relevant events. I also realized that we need to run for tags, not only for pushes, so I opened a second suggestion for that with #12734 (comment). |
Good catch, added ... |
cf57eb5
to
3370887
Compare
Co-authored-by: morre <[email protected]>
748f381
to
cff2630
Compare
Fixes #10760