1
0
mirror of synced 2026-01-04 09:06:46 -05:00
Files
docs/.github/actions/cache-nextjs/action.yml
2024-01-24 21:24:35 +00:00

19 lines
788 B
YAML

# Based on https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions
name: Cache Nextjs build cache
description: Cache the .next/cache according to best practices
runs:
using: 'composite'
steps:
- name: Cache .next/cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-v13-${{ hashFiles('**/package-lock.json') }}-