build(ci): cache pnpm store.

This commit is contained in:
Ivan Li 2023-07-09 06:24:36 +00:00
parent 1536ffa319
commit 4f06f56754

View File

@ -18,8 +18,30 @@ jobs:
with: with:
node-version: 16 node-version: 16
- run: npm i --location=global pnpm@7 - uses: https://github.com/pnpm/action-setup@v2
- run: pnpm i name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: https://github.com/actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- run: pnpm build - run: pnpm build
- run: npm run export - run: npm run export