Trigger Dockerfile rebuild/commit on PR #241
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR would edit the github action to rebuild the docker image when a PR is opened targeting
Dockerfile
. That would let us easily review PRs that edit the Dockerfile without needing to manually build things locally or interactively before testing.One TODO: I would need to enable
main
branch protection to stop accidental commits toDockerfile
directly, which would circumvent the action.There is one problem with this approach: if someone else were to fork this repo and make a PR that edits the
Dockerfile
, the workflow would fail. That is very unlikely to happen, so maybe the benefit of being able to check the build on most PRs is worth it.Another approach would be to have github action build a copy of the book using dockerhub, or if it can't find the image, build the image first locally w/o pushing to dockerhub. That would work with forks, and would enable PR review without needing to build the image locally. Big downside is needing to enable an app (netlify etc) to have permissions in our repos, which I'm not a fan of.
Closes #221
(We should take the same approach in the R book repo)
@joelostblom thoughts?