Skip to content

Forgot we switched to main #1

Forgot we switched to main

Forgot we switched to main #1

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: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Install R dependencies
run: |
Rscript -e 'install.packages(c("remotes", "bookdown"))'
Rscript -e 'remotes::install_deps()'
- 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 }}