From 56d04d962e560de0b629cc75dc362b228d923ea6 Mon Sep 17 00:00:00 2001 From: jamesread Date: Mon, 9 Sep 2024 20:22:58 +0100 Subject: [PATCH] Add NEXT JS Build cache --- .github/workflows/build.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a90380e59..9c421bbf2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,3 +1,4 @@ +--- name: Build on: @@ -20,5 +21,18 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' + + # https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions + - uses: actions/cache@v4 + with: + path: | + ~/.npm + ${{ 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') }}- + + - run: npm ci - run: npm run build