-
Notifications
You must be signed in to change notification settings - Fork 14
How to set up and customize GitHub actions robots
Table of Contents generated with DocToc
By default, all automation steps and checks will run. But depending on the needs of your course, you can turn these on and off by going to the config_automation.yml
file and switching options to yes
or no
.
The config_automation.yml
file looks like this:
# Formatting Checks (run at pull request)
check-quizzes: yes
url-checker: yes
render-preview: yes
style-and-sp-check: yes
...
There are two main sets of automation steps and checks run:
-
.github/workflows/pull-request.yml
: run upon opening a pull request -
.github/workflows/render-all.yml
: run upon changes being merged to themain
branch
These actions are triggered upon a pull request being opened. It's set up is in the file: .github/workflows/pull-request.yml
/.
In the config_automation.yml
file it is set by:
check-quizzes: no
By default, it is set to no
. But if you wish to create quizzes on Leanpub, you should set this to yes
. This is not necessary if you only want quizzes for Coursera.
Leanpub needs a particular format for it to upload correctly. This action will look for quizzes in a quizzes
directory and check for these items. The outcome of these quiz checks will be printed to a GitHub comment on your pull request.
In the config_automation.yml
file it is set by:
url-checker: yes
GitHub actions runs a check on all the URLs upon creating a pull request to the main
branch.
If it fails, you'll need to go the Actions
tab of this repository, then find the GitHub check_urls
job for the last commit you just pushed.
Click on check_urls
and the specific step of Check URLs
to see a print out of the URLs tested.
If the URL checker is failing on something that isn't really a URL or doesn't need to be checked, open up the pull-request.yml
, scroll down to the url-check
step add the imposter URL on to the exclude-urls:
argument with a comma in between.
In the config_automation.yml
file it is set by:
render-preview: yes
After you open a pull request, a preview of the renders will be linked in a automatic comment on the pull request. Upon each commit these previews will re-render and edit the comment with the latest render.
These Github Actions are located in render-preview
section of the pull-request.yml
.
These previews do NOT incorporate any changes influenced by any changes to the Docker image if the Dockerfile is also updated in the same pull request.
In the config_automation.yml
file it is set by:
spell-check: yes
Github actions will automatically run a spell check on all Rmd's and md's whenever a pull request to the main
branch is filed.
It will fail if there are more than 2 spelling errors and you'll need to resolve those before being able to merge your pull request. Errors will be printed out on a GitHub comment on your pull request.
To resolve those spelling errors, click on the link with the errors on the autogenerated comment.
Some of these errors may be things that the spell check doesn't recognize for example: ITCR
or DaSL
.
If it's a 'word' the spell check should recognize, you'll need to add this to the dictionary.
Go to the resources/dictionary.txt
file.
Open the file and add the new 'word' to its appropriate place (the words are in alphabetical order).
Then commit the changes to resources/dictionary.txt
to your branch and this should make the spell check status check pass.
In the config_automation.yml file it is set by:
style-code: yes
The styler
package to all style R in all Rmds.
Style changes will automatically be committed back to your branch.
In the config_automation.yml file it looks like:
docker-test: no
By default it is set to no
which means it won't run automatically unless you change this to yes
.
This is only relevant if you have your own Docker image you are managing for your course. If changes are made to Docker-relevant files: Dockerfile
, install_github.R
, or github_package_list.tsv
, this will test re-build the Docker image. If it is successfully built, then it makes sense to merge it to main
but the docker image will not be pushed to Dockerhub
automatically. Follow these instructions to push your Docker image to Dockerhub.
Upon merging changes to any Rmd
or assets/
folder to main
, the course material will be automatically re-rendered.
By default, all rendering steps will be run. But depending on the needs of your course, you can turn these on and off by going to the config_automation.yml
file and switching options to yes
or no
.
render-bookdown: yes
render-leanpub: yes
render-coursera: yes
For publishing to Leanpub, make sure that the render Leanpub option is set to yes: render-leanpub: yes
. See more details about publishing to Leanpub, here.
For publishing to Coursera, make sure render Coursera option is set to yes: render-coursera: yes
. See more details about publishing to Coursera, here.
GitHub action rendering or other GitHub actions may fail sometimes if the input is unexpected or for a number of other reasons.
To investigate why a GitHub action has failed, go to Actions
and click on the failed action. See this article for how to find this information.
If you are unsure what the error message means and have trouble addressing it, please file an issue on the OTTR_Template repository to get help.
If you encounter any problems or have ideas for improvements to this template repository or this getting started guide, please file an issue here! Your feedback is very much appreciated.
Note all materials in this template are licensed CC-BY and can be repurposed freely with attribution.
- Getting started
- Start a new course!
- Start editing course files
- Content creation tips
- Setting up images and videos
- About citations
- About Docker
- Spell check
- URL check
- Generate docx output
- Borrowing chapters between courses
- Most common errors
- Choosing between platforms
- Publishing with Bookdown
- Publishing on Coursera
- Publishing on Leanpub
- Making quizzes private (Leanpub and Coursera)
- Set up user feedback method
- Change title and style
- Credits section
- Adding Google Analytics Traffic Tracking
- Release a course for public viewing