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 3bee479
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ 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
# now if anything has changed at this stage.
restore-keys: |
fastf1-doc-cache
Expand Down Expand Up @@ -94,6 +95,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:
keys: fastf1-doc-cache-${{ hashFiles('./doc_cache/**/*.*') }}
path: ./doc_cache

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

0 comments on commit 3bee479

Please sign in to comment.