Skip to content
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

Merged

Conversation

larhauga
Copy link
Contributor

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 :)

Signed-off-by: Lars Haugan <lars.haugan@sparebank1.no>
Signed-off-by: Lars Haugan <lars.haugan@sparebank1.no>
@larhauga larhauga force-pushed the gha-workflow-main-publish-ghrc branch from bda7706 to 820faf3 Compare November 20, 2023 09:36
Copy link
Member

@anderseknert anderseknert left a 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.

@@ -0,0 +1,37 @@
name: PR Check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed.

- name: Check out code
uses: actions/checkout@v3

- name: generate-tag
Copy link
Member

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.

Copy link
Contributor Author

@larhauga larhauga Nov 20, 2023

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 :)

Copy link
Member

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 :)

Copy link
Contributor Author

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>
Copy link
Member

@anderseknert anderseknert left a 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 :)

@anderseknert anderseknert merged commit aac1037 into open-policy-agent:main Nov 20, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants