-
Notifications
You must be signed in to change notification settings - Fork 9
72 lines (59 loc) · 2.03 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
70
71
72
# 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
defaults:
run:
working-directory: ./book/
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_PATHS_ROOT: ~/.local/share/renv
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: 0.3.71
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install system-wide depencies
run: sudo apt-get install -y libgdal-dev libudunits2-dev libmkl-rt libglpk-dev
- name: Cache packages renv
uses: actions/cache@v1
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Restore packages renv
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()
- 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: Render slides
shell: Rscript {0}
run: |
all_dirs <- fs::dir_ls("slides", type = "directory")
all_files <- fs::dir_ls(all_dirs, regexp = "\\.qmd")
purrr::walk(all_files, quarto::quarto_render)
- name: Move slides to book
run: cp -rf ./slides/ ./_book/
- name: Deploy to GitHub pages 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: book/_book