Create FUNDING.yml #13
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 | |
- master | |
pull_request: | |
branches: | |
- main | |
- master | |
name: bookdown | |
jobs: | |
build: | |
runs-on: macos-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v1 | |
with: | |
use-public-rspm: true | |
- name: Install pandoc | |
uses: r-lib/actions/setup-pandoc@v1 | |
- name: Install system dependencies | |
run: | | |
brew install --cask xquartz | |
brew install pkg-config cairo | |
brew install gsl | |
brew install libxml2 | |
- name: Query dependencies | |
run: | | |
install.packages('bookdown', dependencies = TRUE) | |
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: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}- | |
- name: Cache bookdown results | |
uses: actions/cache@v2 | |
with: | |
path: _bookdown_files | |
key: bookdown-${{ hashFiles('**/*Rmd') }} | |
restore-keys: bookdown- | |
- name: Install packages | |
run: | | |
R -e 'remotes::install_deps(dependencies = TRUE)' | |
R -e 'remotes::install_cran("rcmdcheck")' | |
- name: Configure Git user | |
run: | | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Build site | |
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)' | |
- name: Deploy to GitHub pages 🚀 | |
uses: JamesIves/github-pages-deploy-action@4.1.4 | |
with: | |
branch: gh-pages | |
folder: docs |