activated GH actions #26
This file contains 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
on: | |
push: | |
branches: | |
- master | |
name: rmarkdown | |
jobs: | |
render: | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install dependencies | |
env: | |
GITHUB_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
options(pkgType = "binary") | |
options(install.packages.check.source = "no") | |
install.packages(c("distill", "downlit", "memoiR", "rmdformats", "tinytex")) | |
tinytex::install_tinytex(bundle = "TinyTeX") | |
shell: Rscript {0} | |
- name: Render Rmarkdown files | |
run: | | |
RMD_PATH=($(ls | grep "[.]Rmd$")) | |
Rscript -e 'for (file in commandArgs(TRUE)) rmarkdown::render(file, "all")' ${RMD_PATH[*]} | |
Rscript -e 'memoiR::build_githubpages()' | |
- name: GH Pages Theme | |
run: | | |
echo 'theme: jekyll-theme-slate' > docs/_config.yml | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ghpages | |
path: docs | |
deploy: | |
runs-on: ubuntu-latest | |
needs: render | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@4 | |
with: | |
name: ghpages | |
path: docs | |
- name: Deploy to GitHub Pages | |
uses: Cecilapp/GitHub-Pages-deploy@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
with: | |
email: ${{ secrets.EMAIL }} | |
build_dir: docs | |
jekyll: yes |