3
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-23 11:55:30 +00:00

Update remaining docs from v3 to v4 for cache and checkout actions

This commit is contained in:
Bernhard Kaindl 2024-02-10 12:00:00 +01:00 committed by Bernhard Kaindl
parent d4726c8901
commit 5a51ca9756
6 changed files with 86 additions and 86 deletions

View file

@ -23,7 +23,7 @@ If you are using separate jobs for generating common artifacts and sharing them
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Dependencies
run: /install.sh
@ -31,7 +31,7 @@ steps:
- name: Build artifacts
run: /build.sh
- uses: actions/cache/save@v3
- uses: actions/cache/save@v4
id: cache
with:
path: path/to/dependencies
@ -47,7 +47,7 @@ Let's say we have a restore step that computes a key at runtime.
#### Restore a cache
```yaml
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: restore-cache
with:
key: cache-${{ hashFiles('**/lockfiles') }}
@ -55,7 +55,7 @@ with:
#### Case 1 - Where a user would want to reuse the key as it is
```yaml
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
```
@ -63,7 +63,7 @@ with:
#### Case 2 - Where the user would want to re-evaluate the key
```yaml
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: npm-cache-${{hashfiles(package-lock.json)}}
```
@ -74,13 +74,13 @@ There are instances where some flaky test cases would fail the entire workflow a
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
.
. // restore if need be
.
- name: Build
run: /build.sh
- uses: actions/cache/save@v3
- uses: actions/cache/save@v4
if: always() // or any other condition to invoke the save action
with:
path: path/to/dependencies