update posting mechanism #78
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 | |
pull_request: | |
branches: | |
- master | |
name: booklet | |
permissions: | |
contents: write | |
jobs: | |
bookdown: | |
name: build-bookdown | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install system dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y curl libcurl4-doc libcurl4-openssl-dev \ | |
libharfbuzz-dev libfribidi-dev libmagick++-dev libpoppler-cpp-dev \ | |
texlive-extra-utils ghostscript | |
- name: Install pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install tinyTeX | |
uses: r-lib/actions/setup-tinytex@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'release' | |
- name: Install R dependencies via renv | |
uses: r-lib/actions/setup-renv@v2 | |
- name: Cache bookdown results | |
uses: actions/cache@v4 | |
with: | |
path: _bookdown_files | |
key: bookdown-2-${{ hashFiles('**/*Rmd') }} | |
restore-keys: bookdown-2- | |
- name: Render book HTML | |
run: | | |
Rscript -e 'bookdown::clean_book(TRUE)' | |
Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)' | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
if: github.event_name != 'pull_request' | |
with: | |
branch: gh-pages | |
folder: _book/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: _book | |
path: _book/ |