From f18661af98334466bde70193a323bc0e57947e82 Mon Sep 17 00:00:00 2001 From: Ru Chern Chong Date: Sun, 28 Jul 2024 00:41:47 +0800 Subject: [PATCH] Add build cache for Next.js --- .github/workflows/sst.dev.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sst.dev.yml b/.github/workflows/sst.dev.yml index b197021..101e745 100644 --- a/.github/workflows/sst.dev.yml +++ b/.github/workflows/sst.dev.yml @@ -47,6 +47,12 @@ jobs: with: node-version: 20 cache: 'pnpm' + - uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.next/cache + key: ${{ runner.OS }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - name: Install dependencies run: pnpm install - name: Build @@ -68,8 +74,7 @@ jobs: - uses: pnpm/action-setup@v2 with: version: latest - - uses: actions/cache@v3 - name: Setup pnpm cache + - uses: actions/cache@v4 with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}