-
Notifications
You must be signed in to change notification settings - Fork 7
executable file
·64 lines (53 loc) · 1.54 KB
/
build_book.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
on:
push:
branches:
- master
pull_request:
branches:
- master
name: build-book
env:
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }}
jobs:
build:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
runs-on: macOS-latest
steps:
- name: Checkout repo
uses: actions/checkout@master
- name: Setup R
uses: r-lib/actions/setup-r@master
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@master
- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: r-6-${{ hashFiles('DESCRIPTION') }}
restore-keys: r-6-
- name: Install pak
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
shell: Rscript {0}
- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
shell: Rscript {0}
- name: Cache bookdown results
uses: actions/cache@v1
with:
path: _bookdown_files
key: bookdown-2-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-2-
- name: Build book
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-github-pages@v2.2.0
with:
target_branch: gh-pages
build_dir: _book
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}