Skip to content

Commit

Permalink
✨ feat: 更新ci缓存方式
Browse files Browse the repository at this point in the history
  • Loading branch information
gylove1994 committed Sep 16, 2024
1 parent f8f5f65 commit 28cb01e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,23 @@ jobs:
node-version: '20' # 根据你的项目需求选择合适的 Node.js 版本

- name: Install pnpm
run: npm install -g pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm modules
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
Expand Down

0 comments on commit 28cb01e

Please sign in to comment.