From bdcf2c5c244a8ef0c6a9bb888d8223a70a8159d6 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 12 Apr 2026 22:37:36 -0500 Subject: [PATCH] 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. --- .github/workflows/ci.yml | 9 +++++++++ .github/workflows/pipeline.yml | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e14add275..fab425cfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 75ad95508..d1dd34ee2 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -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