feat: add build hash to sidebar footer and Gitea CI/CD deploy workflow
Some checks failed
Deploy to VPS / deploy (push) Has been cancelled
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>
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user