-
Notifications
You must be signed in to change notification settings - Fork 11
56 lines (48 loc) · 1.3 KB
/
build_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
on:
push:
pull_request:
name: Build and deploy book
jobs:
build_bookdown:
name: "Build Bookdown Site"
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{github.ref}}
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: "4.0.5"
- name: Install System Dependencies
run: |
sudo apt-get install pandoc libnlopt-dev libcurl4-openssl-dev
- name: Render Book
run: |
R -e "renv::restore()"
R -e 'bookdown::render_book(output_dir = "site")'
touch site/.nojekyll
- uses: actions/upload-artifact@v3
with:
name: site
path: site/
publish_to_ghp:
name: "Publish to GitHub Pages"
if: ${{github.ref}} == "main" & github.event_name != 'pull_request'
runs-on: ubuntu-latest
needs: build_bookdown
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{github.ref}}
- uses: actions/[email protected]
with:
name: site
path: site/
- uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: site