Skip to content

[skip-tutocheck] try different GHA approach #38

[skip-tutocheck] try different GHA approach

[skip-tutocheck] try different GHA approach #38

on:
push:
branches:
- master
- development
pull_request:
branches:
- master
- development
name: Render bookdown website
jobs:
build-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::knitr
any::rmarkdown
any::bookdown
any::htmlwidgets
any::geodata
any::rsvg
any::png
any::raster
any::ggplot2
any::ggpubr
- name: Render Bookdown
run: |
source(".github/workflows/render.R", echo = TRUE)
shell: Rscript {0}
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'docs/'
checkout-and-deploy:
if: |
!contains(github.event.commits[0].message, '[skip-ci]') &&
!contains(github.event.commits[0].message, '[skip-renderbook]')
needs: build-bookdown
runs-on: ubuntu-20.04
steps:
- name: Deploy to GitHub pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
branch: gh-pages
folder: docs
# 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