-
Notifications
You must be signed in to change notification settings - Fork 11
65 lines (55 loc) · 2.22 KB
/
bookdown_action.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# 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
# github docs on actions https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions
# borrowed caching and dependency install from https://github.com/ropenscilabs/statistical-software-review-book/blob/main/.github/workflows/main.yml
on:
push:
branches: [main, master]
name: bookdown
jobs:
bookdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
AUTHOR: ${{ github.event.pusher.name }}
steps:
# check for more recent versions
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install system dependencies
run: |
sh sys_deps/sys_deps.sh
# potentially drop to keep from locking package versions
# look into how this impacts build
- uses: r-lib/actions/setup-renv@v2
# - name: Install libgit2
# run: sudo apt install libgit2-dev
- name: Cache bookdown results
uses: actions/cache@v2
with:
path: _bookdown_files
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-
- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: r-${{ hashFiles('DESCRIPTION') }}
restore-keys: r-
## do we need this step given that we are using renv??
# - name: Install dependencies
# run: Rscript -e 'install.packages("remotes")' -e 'remotes::install_deps(dependencies = TRUE)'
# should we build bookdown::gitbook vs default?
- name: Build site
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
# generate pdf? see R open sci
# Maelle - bootstrap 4 - nicer format (change output format )
# see hand coded examples from Mark -
- name: Deploy to GitHub pages 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: _book #added folder but unclear if it will still be missing