Skip to content

Commit

Permalink
💚 Add Get pnpm store directory logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumeisongsong committed Sep 2, 2024
1 parent 1e43451 commit 22fb13e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,25 @@ jobs:
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
id: cache-pnpm-store
uses: actions/cache@v4
env:
cache-name: pnpm-store-cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-
- name: Install dependencies
if: ${{ steps.cache-pnpm-store.outputs.cache-hit == 'false' }}
run: pnpm install --frozen-lockfile

- name: Build with Next.js
run: pnpm next build
- name: Upload artifact
Expand Down

0 comments on commit 22fb13e

Please sign in to comment.