Skip to content

Commit

Permalink
fix: npm cache
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Dec 24, 2024
1 parent 02b54c2 commit 6ae58c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/beta_site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache: 'pnpm'

# 添加 pnpm 安装
- name: Install pnpm
run: npm install -g pnpm

# 安装根目录依赖
- name: Install root dependencies
Expand All @@ -28,6 +32,13 @@ jobs:
- name: Build root project
run: pnpm run build --if-present

# site 目录使用 npm,需要单独配置 npm 缓存
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: site/package-lock.json

# 安装和构建 site 目录
- name: Install and build site
working-directory: site
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:

# 安装根目录依赖
- name: Install root dependencies
run: pnpm install
run: npm install

# 构建根目录项目
- name: Build root project
run: pnpm run build --if-present
run: npm run build --if-present

# 安装和构建 site 目录
- name: Install and build site
Expand Down

0 comments on commit 6ae58c5

Please sign in to comment.