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