perf(ci): add pnpm caching to storybook workflow
Deploy Storybook / Build and Deploy Storybook (push) Waiting to run
Details
Deploy Storybook / Build and Deploy Storybook (push) Waiting to run
Details
- Setup pnpm before setup-node so caching can detect it - Enable node cache for pnpm in setup-node action - Add explicit pnpm store caching with actions/cache@v4 - Key based on pnpm-lock.yaml hash for cache invalidation This should dramatically speed up subsequent builds by reusing the pnpm store instead of downloading 2563 packages each time.
This commit is contained in:
parent
f04a6ff0b0
commit
082b895982
|
|
@ -22,13 +22,26 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache pnpm store
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
|
|
|||
Loading…
Reference in New Issue