Skip to content

use github's cache workflow (#118) #33

use github's cache workflow (#118)

use github's cache workflow (#118) #33

on:
workflow_dispatch:
schedule:
- cron: "0 13 * * 2"
name: gallery-weekly
jobs:
gallery-weekly:
runs-on: ubuntu-latest
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- id: setup
uses: r-lib/actions/setup-r@v2
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: pre-release
- name: Cache R packages
uses: cache@v3
with:
path: ~/.cache/R/renv
key: ${{ runner.os }}-r-${{ steps.setup.outputs.installed-r-version }}-weekly-lock-${{ hashFiles('mlr-org/renv.lock') }}
restore-keys: ${{ runner.os }}-r-${{ steps.setup.outputs.installed-r-version }}-weekly-lock-
- name: Install System Dependencies
uses: mlr-org/actions/renv-system-dependencies@v1
with:
path: 'mlr-org/renv.lock'
- name: Restore renv environment
run: |
cd mlr-org
R -q -e 'options(Ncpus = 2); install.packages("renv", repos = "cloud.r-project.org"); renv::restore()'
- name: Update renv environment
run: |
cd mlr-org
R -q -e 'renv::update(prompt = FALSE)'
- name: Render gallery
run: |
cd mlr-org
quarto render gallery