This commit is contained in:
1 parent
f0b4bc1630
commit
41002aa36d
2 files changed
+16
-3
No files matched your search
@@ -28,12 +28,13 @@ jobs:
|
|||||||
git fetch origin --prune
|
git fetch origin --prune
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
|
|
||||||
# REMOVE OLD CACHE AND BUILDS
|
# Preserve .next/cache so Next.js can reuse its incremental build cache.
|
||||||
rm -rf .next .output dist
|
# next build safely refreshes stale server/static output itself.
|
||||||
|
rm -rf .output dist
|
||||||
|
|
||||||
# 4. Configure trusted dependencies globally and install cleanly
|
# 4. Configure trusted dependencies globally and install cleanly
|
||||||
export PNPM_CONFIG_ONLY_BUILT_DEPENDENCIES="@parcel/watcher,@swc/core,sharp"
|
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
|
# 5. Apply versioned CMS migrations and generate the Prisma client safely
|
||||||
pnpm db:migrate
|
pnpm db:migrate
|
||||||
|
|||||||
@@ -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");
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user