Skip to content

Commit

Permalink
Merge pull request apache#359 from JLHwung/patch-1
Browse files Browse the repository at this point in the history
add Yarn 2 cache example
  • Loading branch information
aiqiaoy committed Jul 16, 2020
2 parents 55bbcc2 + 5474af7 commit 5c77066
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
- [Node - Lerna](#node---lerna)
- [Node - Yarn](#node---yarn)
- [Node - Yarn 2](#node---yarn-2)
- [OCaml/Reason - esy](#ocamlreason---esy)
- [PHP - Composer](#php---composer)
- [Python - pip](#python---pip)
Expand Down Expand Up @@ -231,6 +232,24 @@ The yarn cache directory will depend on your operating system and version of `ya
${{ runner.os }}-yarn-
```


## Node - Yarn 2
The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/configuration/yarnrc#cacheFolder for more info.

```yaml
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
```

## OCaml/Reason - esy
Esy allows you to export built dependencies and import pre-built dependencies.
```yaml
Expand Down

0 comments on commit 5c77066

Please sign in to comment.