Merge branch 'master' of github.com:EricMarcon/WorkingWithR #36
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: bookdown | |
jobs: | |
renderbook: | |
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") | |
tinytex::tlmgr_install(c("tex-gyre", "tex-gyre-math")) | |
shell: Rscript {0} | |
- name: Render pdf book | |
env: | |
GITHUB_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
bookdown::render_book("index.Rmd", "bookdown::pdf_book") | |
shell: Rscript {0} | |
- name: Render bs4 book | |
env: | |
GITHUB_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
bookdown::render_book("index.Rmd", "bookdown::bs4_book") | |
shell: Rscript {0} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: _book | |
path: docs/ | |
deploy: | |
runs-on: ubuntu-latest | |
needs: renderbook | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
# Artifact name | |
name: _book | |
# Destination path | |
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: no |