Modify award #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
name: render-protocol-book | |
jobs: | |
bookdown: | |
name: Render presenter and developer protocol with bookdown | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install pandoc and pandoc citeproc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install R dependencies | |
run: Rscript -e 'install.packages(c("rmarkdown", "bookdown", "formatR"))' | |
- name: Render the book using bookdown | |
run: Rscript -e 'bookdown::render_book("index.Rmd")' | |
- uses: actions/upload-artifact@v3 | |
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 repository | |
uses: actions/checkout@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
# Artifact name | |
name: _book # optional | |
# Destination path | |
path: _book # optional | |
- name: Deploy to GitHub Pages | |
uses: Cecilapp/GitHub-Pages-deploy@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
email: ${{ secrets.EMAIL }} | |
build_dir: _book # "_site/" by default |