Skip to content

Commit 57b9359

Browse files
authored
Merge pull request #41 from nelson6e65/patch-1
docs(readme): improve Cache example
2 parents 10b4b0b + ec1a8b4 commit 57b9359

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

README.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,36 @@ jobs:
102102
runs-on: ubuntu-latest
103103

104104
steps:
105-
build:
106-
- uses: actions/checkout@v2
107-
108-
- name: Cache pnpm modules
109-
uses: actions/cache@v2
110-
with:
111-
path: ~/.pnpm-store
112-
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
113-
restore-keys: |
114-
${{ runner.os }}-
115-
116-
- uses: pnpm/[email protected]
117-
with:
118-
version: 6.0.2
119-
run_install: true
105+
- name: Checkout
106+
uses: actions/checkout@v3
107+
108+
- name: Install Node.js
109+
uses: actions/setup-node@v3
110+
with:
111+
node-version: 16
112+
113+
- uses: pnpm/[email protected]
114+
name: Install pnpm
115+
id: pnpm-install
116+
with:
117+
version: 7
118+
run_install: false
119+
120+
- name: Get pnpm store directory
121+
id: pnpm-cache
122+
run: |
123+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
124+
125+
- uses: actions/cache@v3
126+
name: Setup pnpm cache
127+
with:
128+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
129+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
130+
restore-keys: |
131+
${{ runner.os }}-pnpm-store-
132+
133+
- name: Install dependencies
134+
run: pnpm install
120135
```
121136
122137
**Note:** You don't need to run `pnpm store prune` at the end; post-action has already taken care of that.

0 commit comments

Comments
 (0)