Skip to content

c05 edits

c05 edits #18

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 }}