1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-12-23 12:36:01 +01:00

Update yarn cache example (#70)

* Update yarn cache example

* Update examples.md

Co-Authored-By: Eric Taylor <erictaylor89@gmail.com>
This commit is contained in:
Josh Gross 2019-11-13 10:18:47 -05:00 committed by GitHub
parent f0cbadd748
commit 50a2fdee6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,12 +112,17 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o
``` ```
## Node - Yarn ## Node - Yarn
The yarn cache directory will depend on your operating system and version of `yarn`. See https://yarnpkg.com/lang/en/docs/cli/cache/ for more info.
```yaml ```yaml
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1 - uses: actions/cache@v1
with: with:
path: ~/.cache/yarn path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
``` ```