Some checks failed
Deploy to VPS / deploy (push) Has been cancelled
- Inject git commit short hash at build time via NEXT_PUBLIC_BUILD_HASH - Display build hash in sidebar footer for version tracking - Add Gitea Actions workflow to auto-deploy on push to master (SSH → pull → rebuild) Co-Authored-By: Paperclip <noreply@paperclip.ing>
21 lines
433 B
TypeScript
21 lines
433 B
TypeScript
import type { NextConfig } from "next";
|
|
import { execSync } from "child_process";
|
|
|
|
const commitHash = (() => {
|
|
try {
|
|
return execSync("git rev-parse --short HEAD").toString().trim();
|
|
} catch {
|
|
return "dev";
|
|
}
|
|
})();
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
serverExternalPackages: ["pdf-parse", "drizzle-orm", "pg"],
|
|
env: {
|
|
NEXT_PUBLIC_BUILD_HASH: commitHash,
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|