Skip to content

Update 02e_manual_technical_matters.Rmd #30

Update 02e_manual_technical_matters.Rmd

Update 02e_manual_technical_matters.Rmd #30

Workflow file for this run

on:
push:
branches:
- master
name: build-book
jobs:
build:
name: Build-Book
runs-on: macOS-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup R
id: install-r
uses: r-lib/actions/setup-r@v2
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Cache R packages
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-2-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-2-
- name: Install macOS system dependencies
if: runner.os == 'macOS'
run: |
brew install libgit2 libxml2
- name: Install dependencies
run: |
install.packages(c("remotes", "sessioninfo"))
shell: Rscript {0}
- name: Install rmarkdown
run: |
install.packages("rmarkdown")
install.packages("bslib")
install.packages("downlit")
install.packages("bookdown")
install.packages("xml2")
shell: Rscript {0}
- name: Install book dependencies
run: |
install.packages(c("dplyr", "data.table", "here", "sessioninfo"))
shell: Rscript {0}
- name: Install biodosetools
run: |
install.packages("biodosetools")
shell: Rscript {0}
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Cache bookdown results
uses: actions/cache@v4
with:
path: _bookdown_files
key: bookdown-2-${{ hashFiles('**/*Rmd') }}
- name: Build site
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
- uses: actions/upload-artifact@v4
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: build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
# Artifact name
name: _book # optional
# Destination path
path: _book # optional
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
EMAIL: ${{ secrets.EMAIL }} # must be a verified email
GITHUB_TOKEN: ${{ secrets.GH_PAT }} # https://github.com/settings/tokens
with:
build_dir: _book/ # "_site/" by default