-
Notifications
You must be signed in to change notification settings - Fork 1
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
Setup the repo #1
Conversation
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 is part of what we need, but we should also include the spelling.R
script from other repos here.
I would even put it in /usr/local/bin in the image and make it executable, so one does not need to call Rscript
at all when running jobs in actions.
Something like the following added to the Dockerfile:
COPY spelling.R /usr/local/bin/spelling.R
RUN chmod +x /usr/local/bin/spelling.R
.github/workflows/build-docker.yaml
Outdated
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: user/app:latest |
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 is a string literal, so not what you want the tag to be.
I would use docker/metadata-action
to automatically set this. It's worth it even for small potatoes.
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.
I ported over both the tags and labels here after the metadata action, but wasn't entirely sure if we needed them both?
Getting closer! Also thinking of next steps, I'm not entirely sure how directories/OS will work between a dictionary file stored in the repo we're spell checking, and the spell check script itself. My sense is since we've placed the script as an executable in a directory that is presumably in |
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.
Also thinking of next steps, I'm not entirely sure how directories/OS will work between a dictionary file stored in the repo we're spell checking, and the spell check script itself. My sense is since we've placed the script as an executable in a directory that is presumably in
$PATH
, we maybe don't have to think about it at all and things will just...work?
Yes, that was the idea!
But I was thinking about it, and had a few evening hacking minutes, so I made a branch where we actually make an action...
This made a few more changes to the Dockerfile, like adding an entrypoint (and then not bothering to put the script in /usr/local/bin, but just leaving it at the root).
The action isn't quite done, and we still would want to push the docker image with an action here it doesn't rebuild on every run, but the idea of the changes are in https://github.com/AlexsLemonade/spellcheck/tree/jashapiro/action
I also fixed a few bugs in the script, and made the dictionary the first argument, so that path can be more flexible (but with the same default).
I'm not filing it as a PR to this branch just yet, but I could if you like it.
Needs some more docs though.
spell-check.R
Outdated
dictionary <- readLines(dict_file) | ||
|
||
# Run spell check | ||
spelling_errors <- spelling::spell_check_files(files, ignore = dictionary_plus) |> |
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.
you didn't define dictionary_plus
?
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.
copy/paste fail 😞
I don't see a good reason not to really? Helps move things along, can't hurt! |
Make it a full action
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.
Okay, so this needs to go in to trigger a build, but I had one more suggestion to have the Docker build always happen but push only when the action is actually the change to main
.
Co-authored-by: Joshua Shapiro <[email protected]>
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 do it!
|
||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 |
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.
Update to latest version to quiet a warning
uses: docker/metadata-action@v4 | |
uses: docker/metadata-action@v5 |
This PR pretty much sets up the repo all around:
Dockerfile
maintainer
label either - should we?spell-check.yaml
and used the baserocker/tidyverse
and installedspelling
. But, I didn't specify the repo with, repos = c(CRAN = '$CRAN'))"
. Should I add this?docker metadata
step found in that linked GHA since this is a much smaller potatoes image.Also note that I set up this repo with the
MIT
license. Any thoughts there?