-
Notifications
You must be signed in to change notification settings - Fork 7
50 lines (44 loc) · 1.51 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
on:
push:
branches:
- main
name: renderbook
jobs:
bookdown:
name: Render-Book
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3 # was v1 before
- uses: r-lib/actions/setup-r@v2 # was v1 before
- uses: r-lib/actions/setup-pandoc@v2 # was v1 before
- name: Install rmarkdown
run: Rscript -e 'install.packages(c("rmarkdown","bookdown","kableExtra"))'
- name: Render Book
run: Rscript -e 'bookdown::render_book("index.Rmd")'
- uses: actions/upload-artifact@v1
with:
name: docs
path: docs/
# Need to first create an empty gh-pages branch
# see https://pkgdown.r-lib.org/reference/deploy_site_github.html
# and also add secrets for a GH_PAT and EMAIL to the repository
# gh-action from Cecilapp/GitHub-Pages-deploy
checkout-and-deploy:
runs-on: ubuntu-latest
needs: bookdown
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifact
uses: actions/[email protected]
with:
# Artifact name
name: docs # optional
# Destination path
path: docs # optional
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v2
env:
EMAIL: ${{ secrets.EMAIL }} # must be a verified email
GH_TOKEN: ${{ secrets.GH_PAT }} # https://github.com/settings/tokens
BUILD_DIR: docs/ # "_site/" by default