Update index.Rmd #39
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: main | |
name: bookdown | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install pandoc and pandoc citeproc | |
uses: r-lib/actions/setup-pandoc@v1 | |
- name: Install rsvg-convert | |
run: | | |
sudo apt-get install librsvg2-bin | |
- uses: r-lib/actions/setup-tinytex@v1 | |
- name: Query dependencies | |
run: | | |
install.packages('remotes') | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | |
shell: Rscript {0} | |
- name: Cache R packages | |
uses: actions/cache@v1 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ hashFiles('.github/R-version') }}-2- | |
- name: Cache bookdown results | |
uses: actions/cache@v1 | |
with: | |
path: _bookdown_files | |
key: bookdown-${{ hashFiles('**/*Rmd') }} | |
restore-keys: bookdown- | |
- name: Install dependencies | |
run: | | |
remotes::install_deps(dependencies = TRUE) | |
shell: Rscript {0} | |
- name: Build site | |
run: Rscript -e 'bookdown::render_book("index.Rmd", "bookdown::gitbook", quiet = TRUE)' | |
- name: Build PDF & epub | |
run: | | |
options(tinytex.verbose = TRUE) | |
bookdown::render_book('index.Rmd', 'bookdown::pdf_book') | |
bookdown::render_book('index.Rmd', 'bookdown::epub_book') | |
shell: Rscript {0} | |
- name: deploy | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: _book # The folder the action should deploy. |