This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
69 lines (58 loc) · 2.33 KB
/
bookdown.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# 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: macos-13
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")'
R -e 'install.packages("Matrix")'
R -e 'install.packages("MatrixModels")'
- 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