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

added git actions workflow file #1678

Merged
merged 6 commits into from
Oct 29, 2020
Merged

added git actions workflow file #1678

merged 6 commits into from
Oct 29, 2020

Conversation

shimwell
Copy link
Member

@shimwell shimwell commented Oct 5, 2020

Just a thought but I'm wondering if the recently updated dockerfile could be automatically build and published on dockerhub each time a push to develop branch is made.

There is a Github action for automating such a task https://github.com/docker/build-push-action

This PR would need to be accompanied with some new repository secrets that grant access to the dockerhub account
DOCKERHUB_USERNAME
DOCKERHUB_TOKEN

If people are happy with this then I can also add a openmc:latest image on pushes to master branch

@paulromano
Copy link
Contributor

@shimwell This would be great. By all means, please push forward and let me know what you need from me to support. Seems like we should have openmc:develop that matches the develop branch and openmc:latest that matches the master branch.

@shimwell
Copy link
Member Author

shimwell commented Oct 19, 2020

I was just hoping that the additional trigger (on PR with develop) would trigger the github actions so I could see this working before it is merged into develop.

But it appears that PR from fork doesn't trigger git actions as a security feature.

So I removed that additional trigger. I would be nice to see this running before hand but I think the only way we can do that is to PR from a repo branch (not a fork) or merge to develop and hope the triggers work.

Also I'm not able to check the secrets have been added for a DOCKERHUB_USERNAME and a
DOCKERHUB_TOKEN

I have added a dockerhub build for merges to the master branch called openmc:latest

@pshriwise
Copy link
Contributor

@shimwell this is great! Thanks for adding this. It would be nice to combine some of these common steps in the workflow, but sadly it doesn't look like GH is supporting the use of templates for workflows yet. Another solution might be to write our own local GitHub action for this, but I think for the sake of simplicity it would be best to leave that investigation for later.

@pshriwise
Copy link
Contributor

pshriwise commented Oct 19, 2020

One other note is that it would be great to add automated pushing on creation of new version tags. It looks like our last version pushed to dockerhub was v0.10.0.

@shimwell
Copy link
Member Author

I think this version tagging is possible, I have just not done it before. Give me a few days to look into it as I think I need to make a new example / test repo. I shall get back to you on that.

@shimwell
Copy link
Member Author

Here is the minimal example repository that I've made to show that a release can trigger a github action and subsequent dockerhub image upload
https://github.com/Shimwell/example-dockerhub-upload

As you can see from the dockerhub there are three images for this repo, one develop, one latest and one with the release version number
https://hub.docker.com/repository/registry-1.docker.io/shimwell/example-dh-upload/tags?page=1

@shimwell
Copy link
Member Author

shimwell commented Oct 19, 2020

This new .yml should trigger on releases and assumes a tag of v*..
It should trigger from the next release onwards.

I have added @pshriwise and @paulromano to an example repository just in case you want to test making a pretend release, push to develop, push to main all of which trigger the Github actions.

@paulromano
Copy link
Contributor

@shimwell I've added DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets on the openmc repo here. Are there any further changes you need to make on this branch or should it work as is?

@shimwell
Copy link
Member Author

shimwell commented Oct 28, 2020

Thanks @paulromano that should be all that is needed, the first image should build when this is merged to develop

@paulromano paulromano merged commit ed45d6e into openmc-dev:develop Oct 29, 2020
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.

3 participants