-
Notifications
You must be signed in to change notification settings - Fork 5
63 lines (56 loc) · 1.59 KB
/
deploy_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
on:
push:
branches:
- main
name: deploy_bookdown
jobs:
bookdown:
name: bookdown
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Cache Renv packages
uses: actions/cache@v2
with:
path: ~/Library/Caches/org.R-project.R/R/renv
key: renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
renv-
- name: Cache bookdown outputs
uses: actions/cache@v2
with:
path: _book
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: |
bookdown-
- name: Install R packages
run: |
R -e 'install.packages("renv")'
R -e 'renv::restore()'
- name: Render Book
run: Rscript -e 'bookdown::render_book()'
- uses: actions/[email protected]
with:
name: _book
path: _book/
# Published to `gh-pages` branch
checkout-and-deploy:
runs-on: ubuntu-latest
needs: bookdown
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v2
with:
# Optional artifact name
name: _book
# Optional destination path
path: _book
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: _book # The folder the action should deploy.