Last active
November 7, 2022 23:22
-
-
Save benmarwick/4e239fcbd05db928e1b988a92fb32285 to your computer and use it in GitHub Desktop.
GitHub workflow to render all Rmd files in a GitHub repo, e.g. for testing student assignments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://github.com/cboettig/compendium/blob/master/.github/workflows/main.yml | |
on: [push] | |
name: render all R Markdown documents | |
jobs: | |
render: | |
name: render all R Markdown documents | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: r-lib/actions/setup-r@v1 | |
- uses: r-lib/actions/setup-pandoc@v1 | |
- uses: r-lib/actions/setup-tinytex@master | |
- name: Install known depedencies | |
run: | | |
Rscript -e "install.packages(c('bookdown', 'tidyverse', 'rmarkdown', 'knitr', 'devtools', 'here'))" | |
Rscript -e "devtools::install_github('ThinkR-open/attachment')" | |
- name: Install unknown depedencies | |
run: | | |
Rscript -e "attachment::install_if_missing(attachment::att_from_rmds(path = '.'))" | |
- name: render all R Markdown documents | |
run: | | |
Rscript -e "lapply(list.files(pattern = 'Rmd|rmd', recursive = TRUE), rmarkdown::render)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment