-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Changed GH action to publish images from the preview branch too #2153
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
base: main
Are you sure you want to change the base?
Conversation
14fe895
to
dabaaf7
Compare
@bmispelon This is not a direct review for this PR, but I have a question: How do we feel about making this configurable? We can add a workflow_dispatch trigger, and the person doing the deployment can select which branch they need to be dockerized. This could only need a couple of lines of change in the action (I need to check how it affects the deployment script but I don't expect a huge change), and I'm willing to help with that. Having a "branch" input in the workflow will remove the need to have a specific branch for preview/test deployments. |
.github/workflows/docker-publish.yml
Outdated
tags: | | ||
# set latest tag for main branch only | ||
type=raw,value=latest,enable={{is_default_branch}} |
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.
Do we need to make this dynamic? I believe having a hardcoded "main" is safe enough.
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 got the {{is_default_branch}}
from the action's documentation: https://github.com/docker/metadata-action?tab=readme-ov-file#latest-tag. I do agree that having a hardcoded main
is unlikely to cause issues so I'm happy to change that.
That would work too I guess.
My strategy with this proposal was to do the simplest thing that works. A |
I've also created to do the same for Trac: django/code.djangoproject.com#270 |
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.
Looks good to me! 🚢
I believe this is all that's needed in order to start publishing a
preview
tag to the docker registry used for deployment.Here's some documentation about the strange
{{is_default_branch}}
condition: https://github.com/docker/metadata-action?tab=readme-ov-file#latest-tag.I removed the
flavor: latest=true
to avoid tagging a preview image withlatest
.Refs #1922