Merge pull request 'perf(deploy): restore .next/cache between deploys' (#5) from feat/deploy-restore-next-cache into main
Local Build and Deploy / deploy (push) Successful in 1m19s

Reviewed-on: #5
This commit is contained in:
Simo committed 2026-07-18 21:17:16 +02:00
commit 0582eed5ab
2 files changed
+7 -4

No files matched your search

+3 -2
View File
@@ -88,8 +88,9 @@ jobs:
rm -f tsconfig.tsbuildinfo .tsbuildinfo
find . -maxdepth 3 -name '*.tsbuildinfo' -delete 2>/dev/null || true
# Wipe .next entirely — partial cache has disagreed with clean sources.
rm -rf .output dist .next
# Clear generated Next types/dev dirs, but keep .next/cache for faster rebuilds.
# Full src/ nuclear replace above already guarantees sources match HEAD.
rm -rf .output dist .next/types .next/dev
# Release tag for Sentry / logs (short git sha)
export APP_VERSION="$(git rev-parse --short HEAD)"
+4 -2
View File
@@ -8,8 +8,10 @@ describe("production deploy workflow", () => {
"utf8",
);
it("wipes .next before build to avoid stale Next typecheck caches", () => {
expect(workflow).toContain("rm -rf .output dist .next");
it("preserves the Next.js incremental build cache", () => {
// May clear .next/types or .next/dev, but must not wipe the whole .next tree.
expect(workflow).not.toMatch(/rm\s+-rf\s+\.next(?:\s|$)/);
expect(workflow).toContain("rm -rf .output dist .next/types .next/dev");
expect(workflow).toContain("pnpm install --frozen-lockfile");
expect(workflow).toContain("SKIP_ENV_VALIDATION=1");
});