Add files via upload #427
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: | |
# Default branches below | |
- main | |
- master | |
name: renderbook | |
jobs: | |
bookdown: | |
name: Render-Book | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
# More detail here, https://github.com/r-lib/actions | |
# It's possible to define R and pandoc version if desired | |
- uses: r-lib/actions/setup-r@v1 | |
- uses: r-lib/actions/setup-pandoc@v1 | |
- name: Install TinyTeX | |
uses: r-lib/actions/setup-tinytex@v1 | |
env: | |
# install full prebuilt version | |
TINYTEX_INSTALLER: TinyTeX | |
- name: Install rmarkdown | |
run: Rscript -e 'install.packages(c("rmarkdown","bookdown", "dplyr", "cowplot", "reshape", "stringr", "ggplot2", "forcats"), dependencies = TRUE)' | |
- name: Render Book | |
run: Rscript -e 'bookdown::render_book("index.Rmd")' | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: _book | |
path: _book/ | |
checkout-and-deploy: | |
runs-on: ubuntu-20.04 | |
needs: bookdown | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
# Artifact name | |
name: _book # optional | |
# Destination path | |
path: _book # optional | |
- name: Deploy to GitHub Pages | |
uses: Cecilapp/GitHub-Pages-deploy@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
build_dir: _book | |
branch: gh-pages |