-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (41 loc) · 1.27 KB
/
bookdown.yml
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
on:
push:
branches:
- main
- master
name: bookdown
jobs:
build:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_PATHS_ROOT: ~/.local/share/renv
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup R
uses: r-lib/actions/setup-r@v1
- name: Install pandoc
run: |
brew install pandoc
- name: Cache renv packages
uses: actions/cache@v1
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Restore renv packages
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()
- name: Build site
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
- name: Commit automatic build
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add docs
git commit docs -m 'Automatic build' || echo "No changes"
git push origin || echo "No changes to commit"