fix: preserve Next.js deploy cache
Local Build and Deploy / deploy (push) Successful in 45s

This commit is contained in:
Simo committed 2026-07-12 15:17:16 +02:00
1 parent f0b4bc1630
commit 41002aa36d
2 files changed
+17 -4

No files matched your search

+5 -4
View File
@@ -28,12 +28,13 @@ jobs:
git fetch origin --prune
git reset --hard origin/main
# REMOVE OLD CACHE AND BUILDS
rm -rf .next .output dist
# Preserve .next/cache so Next.js can reuse its incremental build cache.
# next build safely refreshes stale server/static output itself.
rm -rf .output dist
# 4. Configure trusted dependencies globally and install cleanly
export PNPM_CONFIG_ONLY_BUILT_DEPENDENCIES="@parcel/watcher,@swc/core,sharp"
pnpm install
pnpm install --frozen-lockfile
# 5. Apply versioned CMS migrations and generate the Prisma client safely
pnpm db:migrate
@@ -57,4 +58,4 @@ jobs:
exit 1
fi
echo "--- Deployment successfully completed ---"
echo "--- Deployment successfully completed ---"
+12
View File
@@ -0,0 +1,12 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
describe("production deploy workflow", () => {
const workflow = readFileSync(resolve(process.cwd(), ".gitea/workflows/deploy.yaml"), "utf8");
it("preserves the Next.js incremental build cache", () => {
expect(workflow).not.toMatch(/rm\s+-rf[^\n]*\.next/);
expect(workflow).toContain("pnpm install --frozen-lockfile");
});
});