Skip to content

Quarto Publish

Quarto Publish #27

Workflow file for this run

on:
workflow_dispatch:
schedule:
- cron: "0 23 * * 0"
push:
branches: main
name: Quarto Publish
jobs:
build-quarto:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
build-deploy-renv:
runs-on: ubuntu-latest
needs: build-quarto
permissions:
contents: write
steps:
- name: Install R with renv
uses: r-lib/actions/setup-r@v2
with:
r-version: renv
if: ${{ hashFiles('renv.lock') != '' }}
- name: Install R Dependencies with renv
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 1
if: ${{ hashFiles('renv.lock') != '' }}
build-deploy-no-renv:
runs-on: ubuntu-latest
needs: build-quarto
permissions:
contents: write
steps:
- name: Cache R packages
uses: actions/cache@v3
with:
path: ${{ runner.tool_cache }}/R
key: ${{ runner.os }}-R-${{ hashFiles('**/*.lock') }}
restore-keys: |
${{ runner.os }}-R-
if: ${{ hashFiles('renv.lock') == '' }}
- name: Install R latest
uses: r-lib/actions/setup-r@v2
if: ${{ hashFiles('renv.lock') == '' }}
- name: Install R latest dependencies
run: |
install.packages("renv")
install.packages("rmarkdown")
install.packages("yaml")
install.packages(renv::dependencies()$Package)
shell: Rscript {0}
if: ${{ hashFiles('renv.lock') == '' }}
render-and-publish:
runs-on: ubuntu-latest
needs: [build-deploy-renv, build-deploy-no-renv]
permissions:
contents: write
steps:
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}