perf(ci): cache Next.js build artifacts with Blacksmith cache

Add useblacksmith/cache@v5 to persist web/.next/cache across CI runs,
eliminating redundant Webpack recompilation of unchanged pages. Applied
to ci.yml build job and pipeline.yml dev-publish/prod-release jobs.
This commit is contained in:
Jeremy 2026-04-12 22:37:36 -05:00
parent cac4f8ac37
commit bdcf2c5c24
2 changed files with 31 additions and 0 deletions

View file

@ -130,6 +130,15 @@ jobs:
- name: Install web host dependencies
run: npm --prefix web ci
- name: Cache Next.js build
uses: useblacksmith/cache@v5
with:
path: web/.next/cache
key: nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-${{ hashFiles('web/app/**', 'web/components/**', 'web/lib/**', 'web/hooks/**') }}
restore-keys: |
nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-
nextjs-${{ runner.os }}-
- name: Build
run: npm run build

View file

@ -24,6 +24,10 @@ jobs:
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
BLACKSMITH_CACHE_TOKEN: ${{ env.BLACKSMITH_CACHE_TOKEN }}
BLACKSMITH_CACHE_URL: ${{ env.BLACKSMITH_CACHE_URL }}
GITHUB_REPO_NAME: ${{ github.repository }}
outputs:
dev-version: ${{ steps.stamp.outputs.version }}
steps:
@ -41,6 +45,15 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Cache Next.js build
uses: useblacksmith/cache@v5
with:
path: web/.next/cache
key: nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-${{ hashFiles('web/app/**', 'web/components/**', 'web/lib/**', 'web/hooks/**') }}
restore-keys: |
nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-
nextjs-${{ runner.os }}-
- name: Build
run: npm run build
@ -153,6 +166,15 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Cache Next.js build
uses: useblacksmith/cache@v5
with:
path: web/.next/cache
key: nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-${{ hashFiles('web/app/**', 'web/components/**', 'web/lib/**', 'web/hooks/**') }}
restore-keys: |
nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-
nextjs-${{ runner.os }}-
- name: Run live LLM tests (optional)
continue-on-error: true
run: npm run test:live