CI/CD with Github actions .next/cache updates all the time
Unanswered
Perro de Presa Canario posted this in #help-forum
Perro de Presa CanarioOP
As I understand based on the instructions cache of .next/cache will be invalidated/rebuilt on any change to source files. What is the point of such cache then?
Instructions from the page below:
uses: actions/cache@v4
with:
# See here for caching with
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('/package-lock.json') }}-${{ hashFiles('/.js', '**/.jsx', '/*.ts', '/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
Instructions from the page below:
uses: actions/cache@v4
with:
# See here for caching with
yarn https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-nodepath: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('/package-lock.json') }}-${{ hashFiles('/.js', '**/.jsx', '/*.ts', '/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-