Skip to content

Commit

Permalink
Update yarn cache example (#70)
Browse files Browse the repository at this point in the history
* Update yarn cache example

* Update examples.md

Co-Authored-By: Eric Taylor <erictaylor89@gmail.com>
  • Loading branch information
2 people authored and GitHub committed Nov 13, 2019
1 parent f0cbadd commit 50a2fde
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,17 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o
```

## 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
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
```
Expand Down

0 comments on commit 50a2fde

Please sign in to comment.