-
Notifications
You must be signed in to change notification settings - Fork 83
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
Improve docker image autobuild workflow #245
Conversation
Let me know if I have missed something important - otherwise, I think this covers all the bases now |
github.event.workflow_run.head_branch per https://github.community/t/workflow-run-doent-preserve-github-ref/155148/5
Sorry - working on this to keep busy while waiting at hospital - running this against my branch to demonstrate working function |
Ok - demonstrated to work as expected Build passes - https://github.com/thenewguy/ippsample/actions/runs/1329947866 This pushed to a docker repo under my namespace since I merged it into my personal branch: https://hub.docker.com/repository/docker/thenewguy/ippsample/tags?page=1&ordering=last_updated This is complete and ready to merge |
@michaelrsweet are you happy with this approach? I have a little bit of sitting around time available for the next day or so - want to make sure you like it before moving on to something else |
Just wanted to update I've been able to work this docker image into some initial testing! Awesome! Thanks for providing the Dockerfile to get all of this rolling |
@thenewguy This looks fine, still not sure what we'll be doing to officially support this but happy to merge it... |
Ok - I will create an issue for the follow up action |
Supersedes #242
Improves #239, #240
Adds the option to push image to Github container registry and/or docker hub
Uses the following secrets:
Simple sanity check runs most commands (see #244) expected to be available. A follow up commit can test they work as expected.
Currently, the docker image is built and tested for the master branch after the test workflow completes. It is built on every commit for PRs to provide continuous feedback during development.
The image is explicitly tagged with the branch/tag, sha, and timestamp. Not sure how you will want release tags to work, but the template is laid out. The
workflow_run
trigger is used to ensure we only push images that have completed the "Build and Test" job on the master branch with a successful conclusion pergithub.event.workflow_run.conclusion == 'success'
. It would be simple to add:stable
or something along those lines when pushing the image - this should be straightforward to adjust in a follow up commit.Images are saved as artifacts with a unique name based on these details to shuffle between steps. This keeps development images from getting into the docker repo and lingering around. Currently, we rely on the artifact retention of 1 day to remove old artifacts after jobs complete. There is supposedly an API for removing them but it is unclear if this can work within the running workflow (refer to actions/upload-artifact#5)