Skip to content

Refactor and add to chapter 3 notes (#51) #55

Refactor and add to chapter 3 notes (#51)

Refactor and add to chapter 3 notes (#51) #55

on:
push:
branches: main
paths-ignore:
- 'README.md'
workflow_dispatch:
name: renderbook
jobs:
bookdown:
name: Render-Book
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
- name: Render Book
run: Rscript -e 'bookdown::render_book("index.Rmd")'
- uses: actions/upload-artifact@v2
with:
name: _book
path: _book/
# 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@main
- name: Download artifact
uses: actions/[email protected]
with:
# Artifact name
name: _book # optional
# Destination path
path: _book # 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: _book/ # "_site/" by default