diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml index 3c118084..745773b3 100644 --- a/.github/workflows/nextjs.yml +++ b/.github/workflows/nextjs.yml @@ -57,7 +57,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: "20" - cache: ${{ steps.detect-package-manager.outputs.manager }} - uses: pnpm/action-setup@v2 name: Install pnpm with: @@ -79,12 +78,12 @@ jobs: uses: actions/cache@v3 with: path: | - .next/cache + ${{ env.STORE_PATH }} # Generate a new cache whenever packages or source files change. - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml','**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} # If source files changed but packages didn't, rebuild from a prior cache. restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml','**/package-lock.json', '**/yarn.lock') }}- + ${{ runner.os }}-pnpm-store- - name: Install dependencies run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} - name: Build with Next.js