This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
Updates #460
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
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
on: | |
push: | |
branches: [main, master] | |
name: bookdown | |
jobs: | |
bookdown: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
CENSUS_API_KEY: ${{ secrets.CENSUS_API_KEY }} | |
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }} | |
steps: | |
- run: sudo apt-get update && sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev libharfbuzz-dev libfribidi-dev libmagick++-dev --fix-missing | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-renv@v2 | |
- name: Install packages missed by renv | |
run: | | |
R -e 'install.packages("downlit")' | |
R -e 'install.packages("ragg")' | |
R -e 'install.packages("svglite")' | |
R -e 'install.packages("webshot2")' | |
R -e 'install.packages("class")' | |
R -e 'install.packages("promises")' | |
- name: Cache bookdown results | |
uses: actions/cache@v2 | |
with: | |
path: _bookdown_files | |
key: bookdown-${{ hashFiles('**/*Rmd') }} | |
restore-keys: bookdown- | |
- name: Build site | |
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)' | |
- name: Deploy to Netlify | |
if: contains(env.isExtPR, 'false') | |
id: netlify-deploy | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: './_book' | |
production-branch: main | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: | |
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})' | |
# these all default to 'true' | |
enable-pull-request-comment: false | |
enable-commit-comment: false | |
# enable-commit-status: true | |
#o verwrites-pull-request-comment: true | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
timeout-minutes: 1 |