Skip to content

set as own chapter

set as own chapter #37

on:
push:
branches:
- master
workflow_dispatch:
name: renderbook
jobs:
bookdown:
name: Render-Book
runs-on: macOS-latest
# defaults:
# run:
# working-directory: bookdown-documents
steps:
- uses: actions/checkout@v1
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- name: Install rmarkdown
run: Rscript -e 'install.packages(c("rmarkdown","bookdown"))'
working-directory: ./manuscript
- name: Render Book
run: Rscript -e 'bookdown::render_book("index.Rmd")'
working-directory: ./manuscript
- uses: actions/upload-artifact@v1
with:
name: docs
path: manuscript/docs/
# 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
# defaults:
# run:
# working-directory: bookdown-documents/
steps:
- name: Checkout
uses: actions/checkout@master
- name: Download artifact
uses: actions/[email protected]
with:
# Artifact name
name: docs # optional
# Destination path
path: docs # optional
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ SECRETS.GITHUB_TOKEN }} # https://github.com/settings/tokens
with:
EMAIL: ${{ SECRETS.EMAIL }} # must be a verified email
BUILD_DIR: docs/
branch: gh-pages
#working-directory: ./manuscript