Caching Example #1497
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
name: "Caching Example" | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- "develop" | |
- "main" | |
- "master" | |
schedule: | |
# Note that cronjobs run on master/main by default | |
- cron: "0 0 * * *" | |
jobs: | |
caching-example: | |
# prevent cronjobs from running on forks | |
if: | |
(github.event_name == 'schedule' && github.repository == | |
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') | |
name: Caching | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v1 | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 2 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('etc/example-environment.yml') }} | |
- uses: ./ | |
with: | |
activate-environment: anaconda-client-env | |
channel-priority: strict | |
environment-file: etc/example-environment-caching.yml | |
use-only-tar-bz2: true |