Skip to content

[skip-tutocheck] GHA: use default libPath, install pkgs before render.R #35

[skip-tutocheck] GHA: use default libPath, install pkgs before render.R

[skip-tutocheck] GHA: use default libPath, install pkgs before render.R #35

on:
push:
branches:
- master
- development
pull_request:
branches:
- master
- development
name: Render bookdown website
jobs:
bookdown:
if: |
!contains(github.event.commits[0].message, '[skip-ci]') &&
!contains(github.event.commits[0].message, '[skip-renderbook]')
runs-on: ubuntu-20.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: PredictiveEcology/actions/install-spatial-deps@main
- uses: r-lib/actions/setup-r@v2
with:
Ncpus: 2
use-public-rspm: false
- uses: r-lib/actions/setup-pandoc@v2
- name: Install TinyTeX
uses: r-lib/actions/setup-tinytex@v2
env:
# install full prebuilt version
TINYTEX_INSTALLER: TinyTeX
- name: Install package dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
packages: |
any::rcmdcheck
any::rmarkdown
any::bookdown
any::htmlwidgets
any::geodata
any::SpaDES
any::ggpubr
any::rsvg
any::png
any::raster
any::quickPlot
any::ggplot2
any::SpaDES.tools
- name: Render Bookdown
run: |
source(".github/workflows/render.R", echo = TRUE)
shell: Rscript {0}
- uses: actions/upload-artifact@v3
with:
name: docs
path: docs/
checkout-and-deploy:
if: |
!contains(github.event.commits[0].message, '[skip-ci]') &&
!contains(github.event.commits[0].message, '[skip-renderbook]')
runs-on: ubuntu-20.04
needs: bookdown
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
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 }}
with:
build_dir: docs/
branch: gh-pages