Skip to content

Commit 5ec113b

Browse files
committed
update ci
1 parent 6f1af1f commit 5ec113b

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,33 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222

23-
- name: Setup Node.js
24-
uses: actions/setup-node@v4
23+
- name: Restore node_modules from cache
24+
id: cache
25+
uses: actions/cache/restore@v4
2526
with:
26-
node-version: ${{ vars.NODE_VERSION }}
27+
path: node_modules/
28+
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
2729

2830
- name: Setup pnpm
31+
if: steps.cache.outputs.cache-hit != 'true'
2932
uses: pnpm/action-setup@v4
3033

31-
- name: Cache node_modules
32-
uses: actions/cache@v4
34+
- name: Setup Node.js
35+
if: steps.cache.outputs.cache-hit != 'true'
36+
uses: actions/setup-node@v4
3337
with:
34-
path: dist/
35-
key: ${{ runner.os }}-build-${{ hashFiles('**/pnpm-lock.yaml') }}
36-
restore-keys: |
37-
${{ runner.os }}-build-
38+
node-version: ${{ vars.NODE_VERSION }}
39+
cache: pnpm
3840

3941
- run: pnpm install --frozen-lockfile --prefer-offline
4042

43+
- name: Save node_modules to cache
44+
if: steps.cache.outputs.cache-hit != 'true'
45+
uses: actions/cache/save@v4
46+
with:
47+
path: node_modules/
48+
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
49+
4150
build:
4251
name: Build
4352
needs: [deps]

0 commit comments

Comments
 (0)