Skip to content

Restructure 07-contributor-guide #117

Restructure 07-contributor-guide

Restructure 07-contributor-guide #117

# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: main
paths: '**.Rmd'
workflow_dispatch:
name: update-bookdown
jobs:
bookdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: install remotes
run: Rscript -e 'install.packages(c("remotes"))'
# Install DiagrammeR for making a code review flowchart
- name: install DiagrammeR
run: Rscript -e 'install.packages(c("DiagrammeR"))'
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: install extra pkgs (suggests or used in rmd files)
run: Rscript -e 'install.packages(c("bookdown"))'
# only needed to check that this workflow does not run multiple times in a row
- name: get last commit msg
id: commit-msg
run: |
git tag
last_commit_msg=$(git log -1 --pretty=%B)
echo "::set-output name=msg::${last_commit_msg}"
- name: Cache bookdown results
uses: actions/cache@v2
with:
path: docs
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-
- name: Build site
run: Rscript -e 'bookdown::render_book(quiet = TRUE)'
- name: Deploy to GitHub pages 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/