3
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2026-01-06 03:42:43 +00:00

docs: Update examples to cache@v5

This commit is contained in:
XZTDean 2025-12-15 06:15:33 -08:00
parent 9255dc7a25
commit de99935c0c
6 changed files with 84 additions and 84 deletions

View file

@ -127,7 +127,7 @@ jobs:
- name: Cache Primes
id: cache-primes
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: prime-numbers
key: ${{ runner.os }}-primes
@ -158,7 +158,7 @@ jobs:
- name: Restore cached Primes
id: cache-primes-restore
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: |
path/to/dependencies
@ -169,7 +169,7 @@ jobs:
.
- name: Save Primes
id: cache-primes-save
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: |
path/to/dependencies
@ -224,7 +224,7 @@ A cache key can include any of the contexts, functions, literals, and operators
For example, using the [`hashFiles`](https://docs.github.com/en/actions/learn-github-actions/expressions#hashfiles) function allows you to create a new cache when dependencies change.
```yaml
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: |
path/to/dependencies
@ -242,7 +242,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: path/to/dependencies
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
@ -264,7 +264,7 @@ Example:
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
- uses: actions/cache@v5
id: cache
with:
path: path/to/dependencies
@ -296,7 +296,7 @@ jobs:
- name: Cache Primes
id: cache-primes
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: prime-numbers
key: primes
@ -307,7 +307,7 @@ jobs:
- name: Cache Numbers
id: cache-numbers
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: numbers
key: primes
@ -323,7 +323,7 @@ jobs:
- name: Cache Primes
id: cache-primes
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: prime-numbers
key: primes