-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 1.76 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
# https://github.com/lucacozzuto/test_bookdown/blob/2814fd4c8dd38fe19bd2e981ed8c24ac17372fa7/.github/workflows/deploy_bookdown.yml
# https://github.com/lucacozzuto/test_bookdown/
on:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: write
name: "gh-pages"
jobs:
bookdown:
name: "Render Bookdown"
runs-on: ubuntu-22.04
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
# More detail here, https://github.com/r-lib/actions
# It's possible to define R and pandoc version if desired
- name: "Install R"
uses: r-lib/actions/setup-r@v2
- name: "Install Pandoc"
uses: r-lib/actions/setup-pandoc@v2
- name: "Install TinyTex"
uses: r-lib/actions/setup-tinytex@v2
env:
# install full prebuilt version
TINYTEX_INSTALLER: TinyTeX
- name: "Install R packages"
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
- name: "Render bookdown"
run: Rscript -e 'bookdown::render_book("index.Rmd")'
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: _book
path: _book/
checkout-and-deploy:
name: Deploy
runs-on: ubuntu-22.04
needs: bookdown
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Download artifact"
uses: actions/download-artifact@v3
with:
# Artifact name
name: _book # optional
# Destination path
path: _book # optional
- name: "Deploy to GitHub Pages"
uses: JamesIves/github-pages-deploy-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
folder: _book