Skip to content

Commit

Permalink
test caching
Browse files Browse the repository at this point in the history
  • Loading branch information
RickGelhausen committed Jun 26, 2024
1 parent 09ad41c commit 71e15eb
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/build-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,34 @@ jobs:
git clone "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" .
shell: bash

- name: create environment with mamba
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
mamba-version: "*"
channels: conda-forge,defaults
auto-activate-base: false
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: rmarkdown-env
environment-file: .github/envs/environment.yml
use-mamba: true

- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{steps.get-date.outputs.today }}-${{hashFiles('etc/example-environment-caching.yml') }}-${{ env.CACHE_NUMBER}}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache

- name: Update environment
run:
mamba env update -n rmarkdown-env -f envs/environment.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Render Rmd files
run: |
Expand Down

0 comments on commit 71e15eb

Please sign in to comment.