Unverified Commit 50a2fdee authored by Josh Gross's avatar Josh Gross Committed by GitHub
Browse files

Update yarn cache example (#70)

* Update yarn cache example

* Update examples.md

Co-Authored-By: default avatarEric Taylor <[email protected]>
parent f0cbadd7
Loading
Loading
Loading
Loading
+7 −2
Changes for examples.md: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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-
```