Skip to content

Commit

Permalink
MNT/CI: switch away from deprecated save-always directive for actions…
Browse files Browse the repository at this point in the history
…/cache
  • Loading branch information
theOehrly committed Oct 27, 2024
1 parent 5e0575c commit bc00f06
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ jobs:
run: |
mkdir doc_cache # make sure cache dir exists
- name: Cache FastF1
uses: actions/cache@v4
- name: Restore cache for FastF1
id: cache-doc-restore
uses: actions/cache/restore@v4
with:
save-always: true
path: ./doc_cache
key: fastf1-doc-cache-${{ hashFiles('*.*') }}
# Restore any matching cache independent of hash suffix. We cannot
# know if anything has changed at this stage.
key: fastf1-doc-cache-${{ hashFiles('./doc_cache/**/*.*') }}
restore-keys: |
fastf1-doc-cache
Expand Down Expand Up @@ -94,6 +96,15 @@ jobs:
with:
path: docs/_build/html/

- name: Save cache for FastF1
id: cache-doc-save
# Save the cache even in case of a failure but only if the content of
# the cached directory has changed.
if: always() && steps.cache-doc-restore.outputs.cache-matched-key != hashFiles('./doc_cache/**/*.*')
uses: actions/cache/save@v4
with:
key: fastf1-doc-cache-${{ hashFiles('./doc_cache/**/*.*') }}
path: ./doc_cache

deploy:
if: (github.event_name == 'release') || inputs.publish
Expand Down

0 comments on commit bc00f06

Please sign in to comment.