Books meta updates (#327) #218
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: | |
- main | |
- master | |
paths: | |
- 'content/**' | |
- 'config.toml' | |
- 'themes/**' | |
- 'static/**' | |
- 'layouts/**' | |
- 'ressources/**' | |
- '.github/workflows/build_site.yaml' | |
name: Build and deploy website | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
RENV_PATHS_ROOT: ~/.local/share/renv | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
id: install-r | |
with: | |
r-version: '4.1.1' | |
use-public-rspm: true | |
- name: Cache Renv packages | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.RENV_PATHS_ROOT }} | |
key: ${{ runner.os }}-renv-1-${{ hashFiles('R/renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv-1- | |
${{ runner.os }}-renv- | |
- name: Install packages | |
run: | | |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") | |
renv::restore(repos = "https://packagemanager.rstudio.com/all/latest") | |
shell: Rscript {0} | |
working-directory: R | |
- name: Session info | |
run: | | |
options(width = 100) | |
renv::install("cli") | |
renv::install("sessioninfo") | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} | |
working-directory: R | |
- name: Install hugo | |
run: | | |
# Pinning version v0.131.0 to work without error with hugo-xmin | |
blogdown::install_hugo("v0.131.0") | |
shell: Rscript {0} | |
working-directory: R | |
- name: build and publish | |
env: | |
RSC_BOOKDOWN_ORG_TOKEN: ${{ secrets.RSC_BOOKDOWN_ORG_TOKEN }} | |
CONTENT_ID: 11 | |
run: Rscript publish.R | |
working-directory: R |