-
Notifications
You must be signed in to change notification settings - Fork 91
46 lines (37 loc) · 1.29 KB
/
deploy-bookdown-netlify.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
name: Deploy Bookdown to Netlify
on:
push:
branches:
- main # Trigger the workflow on pushes to the main branch
pull_request:
branches:
- main # Optional: Trigger on pull requests to main
jobs:
build:
runs-on: macOS-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Install pandoc
run: |
brew install pandoc
- name: Install dummies from RSPM (archived version)
run: |
Rscript -e 'install.packages("dummies", repos = "https://packagemanager.rstudio.com/cran/__linux__/focal/2021-07-01")'
- name: Install R dependencies with r-lib action
uses: r-lib/actions/setup-r-dependencies@v2
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Build bookdown site
run: |
Rscript -e 'bookdown::render_book("index.Rmd", "bookdown::gitbook")'
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2.3
with:
publish-dir: ./_book # Directory where the book is rendered
production-deploy: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}