Skip to content

Commit ac2da68

Browse files
author
perlinson
committed
🔧 fix: 修复 GitHub Pages 缓存配置问题
✨ 修复内容: - 更换缓存配置方式,使用 actions/cache@v3 - 移除有问题的 cache-dependency-path 配置 - 使用更稳定的缓存键名和恢复键 🔧 技术细节: - 缓存 ~/.npm 目录而不是特定路径 - 使用 hashFiles('**/package-lock.json') 生成缓存键 - 添加 restore-keys 提供缓存回退 🎯 解决问题: - 修复 'Some specified paths were not resolved' 错误 - 确保依赖缓存正常工作 - 提升构建速度和稳定性
1 parent 7d3ad6f commit ac2da68

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/pages.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ jobs:
3030
uses: actions/setup-node@v4
3131
with:
3232
node-version: '18'
33-
cache: 'npm'
34-
cache-dependency-path: website/package-lock.json
33+
34+
- name: Cache dependencies
35+
uses: actions/cache@v3
36+
with:
37+
path: ~/.npm
38+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
39+
restore-keys: |
40+
${{ runner.os }}-node-
3541
3642
- name: Install dependencies
3743
working-directory: ./website

0 commit comments

Comments
 (0)