-
Notifications
You must be signed in to change notification settings - Fork 26
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
Workflow for main branch that publishes plugin to ghcr.io #80
Workflow for main branch that publishes plugin to ghcr.io #80
Conversation
Signed-off-by: Lars Haugan <lars.haugan@sparebank1.no>
Signed-off-by: Lars Haugan <lars.haugan@sparebank1.no>
bda7706
to
820faf3
Compare
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.
Using GHCR and automation seems like a good idea to me! Some suggestions posted here for consideration.
.github/workflows/main.yaml
Outdated
@@ -0,0 +1,37 @@ | |||
name: PR Check |
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.
This should be renamed.
.github/workflows/main.yaml
Outdated
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: generate-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.
Rather than generating a tag, we could use edge
for tracking main
. That's how other projects in the OPA or does it.
It would be good if the this flow worked when an actual tag was pushed too, and used that if found.
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.
What do you mean by using edge
here? Are there any good examples in the other projects here?
I can rewrite it to only trigger on tag pushes if that is your preferred way? Like https://github.com/open-policy-agent/opa-envoy-plugin/blob/main/.github/workflows/post-tag.yaml?
Edit: updated the branch with push on 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.
Yep! Or https://github.com/open-policy-agent/opa/blob/main/.github/workflows/post-merge.yaml#L139
I.e. use the tag edge
for tracking what's currently the top of the main branch. That workflow should run on all pushes to main. Then, ideally we'd have another similar workflow that runs only on pushed tags, and which uses the tag for... well, tagging :)
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.
Ok, If I understood you correctly, the PR should be updated with two workflows. Does it look OK to you?
Happy to help getting this the way you want 👍
Signed-off-by: Lars Haugan <lars.haugan@sparebank1.no>
Signed-off-by: Lars Haugan <lars.haugan@sparebank1.no>
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.
LGTM! Let's see if it works :)
Hi and again thanks for this project!
Since it seems that the workflow for publishing new versions of the plugins is a manual process, I have added an (untested) github actions workflow that can publish the plugin to ghcr.io.
This will create a somewhat random tag, but will publish on every push to main.
If this is something that you feel is not what you want, feel free to decline this PR :)