mirror of
https://github.com/pnpm/action-setup.git
synced 2024-12-23 00:06:30 +08:00
Merge pull request #9 from hildjj/cache-docs
Adds documentation hints for caching
This commit is contained in:
commit
9facd4db8e
36
README.md
36
README.md
|
@ -67,7 +67,7 @@ jobs:
|
|||
steps:
|
||||
- uses: pnpm/action-setup@v1.2.1
|
||||
with:
|
||||
version: 4.11.1
|
||||
version: 5.17.2
|
||||
```
|
||||
|
||||
### Install PNPM and a few NPM packages
|
||||
|
@ -85,13 +85,45 @@ jobs:
|
|||
|
||||
- uses: pnpm/action-setup@v1.2.1
|
||||
with:
|
||||
version: 4.11.1
|
||||
version: 5.17.2
|
||||
run_install: |
|
||||
- recursive: true
|
||||
args: [--frozen-lockfile, --strict-peer-dependencies]
|
||||
- args: [--global, gulp, prettier, typescript]
|
||||
```
|
||||
|
||||
### Use cache to reduce installation time
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
**Note:** You don't need to run `pnpm store prune` at the end; post-action has already taken care of that.
|
||||
|
||||
## Notes
|
||||
|
||||
This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.
|
||||
|
|
Loading…
Reference in New Issue
Block a user