feat: add commit hash to environment variables and create HealthPage component to display it

This commit is contained in:
Danel Kungla
2025-07-21 14:59:29 +03:00
parent 8e4d634a7d
commit 8ee9271c2e
2 changed files with 12 additions and 0 deletions

7
app/health/page.tsx Normal file
View File

@@ -0,0 +1,7 @@
const HealthPage = () => {
const commit = process.env.NEXT_PUBLIC_COMMIT_HASH;
return <div>{commit}</div>;
};
export default HealthPage;

View File

@@ -1,5 +1,7 @@
import withBundleAnalyzer from '@next/bundle-analyzer'; import withBundleAnalyzer from '@next/bundle-analyzer';
import { execSync } from 'child_process';
const commitHash = execSync('git rev-parse --short HEAD').toString().trim();
const IS_PRODUCTION = process.env.NODE_ENV === 'production'; const IS_PRODUCTION = process.env.NODE_ENV === 'production';
const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL; const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL;
const ENABLE_REACT_COMPILER = process.env.ENABLE_REACT_COMPILER === 'true'; const ENABLE_REACT_COMPILER = process.env.ENABLE_REACT_COMPILER === 'true';
@@ -68,6 +70,9 @@ const config = {
/** We already do linting and typechecking as separate tasks in CI */ /** We already do linting and typechecking as separate tasks in CI */
eslint: { ignoreDuringBuilds: true }, eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true }, typescript: { ignoreBuildErrors: true },
env: {
NEXT_PUBLIC_COMMIT_HASH: commitHash,
},
}; };
export default withBundleAnalyzer({ export default withBundleAnalyzer({