Adds documentation hints for caching. Fixes #8.

This commit is contained in:
Joe Hildebrand 2021-02-15 14:36:25 -07:00
parent 086f5bd3b6
commit b26427e53e
No known key found for this signature in database
GPG Key ID: E064277F918874D1

View File

@ -92,6 +92,40 @@ jobs:
- args: [--global, gulp, prettier, typescript]
```
### Cache
To speed up install times
```yaml
on:
- push
- pull_request
jobs:
runs-on: ubuntu-latest
steps:
build:
- uses: actions/checkout@v2
- name: Cache pnpm modules
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- uses: pnpm/action-setup@v1.2.1
with:
version: 5.17.2
run_install: true
```
You don't need to run `pnpm store prune` at the end; this package will take care of that for you.
## Notes
This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.