Skip to content

Commit 4a3b600

Browse files
committed
feat: 添加 pnpm 缓存步骤以优化部署流程
1 parent 22b2b33 commit 4a3b600

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,23 @@ jobs:
2525
- name: Setup pnpm
2626
uses: pnpm/action-setup@v2
2727
with:
28-
version: latest
29-
30-
- name: List project structure for debugging
31-
run: |
32-
echo "Project structure:"
33-
find . -type d -not -path "*/node_modules/*" -not -path "*/.git/*" | sort
28+
version: latest
29+
30+
- name: Setup pnpm cache
31+
uses: actions/cache@v3
32+
with:
33+
path: |
34+
~/.pnpm-store
35+
${{ github.workspace }}/.next/cache
36+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
37+
restore-keys: |
38+
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
39+
40+
- name: Install dependencies
41+
run: pnpm install
3442

3543
- name: Build project
36-
id: build
37-
continue-on-error: true
38-
run: |
39-
pnpm install
40-
pnpm build
44+
run: pnpm build
4145

4246
- name: Sync search index
4347
run: |

0 commit comments

Comments
 (0)