feat: add commit hash to environment variables and create HealthPage component to display it
This commit is contained in:
7
app/health/page.tsx
Normal file
7
app/health/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
const HealthPage = () => {
|
||||||
|
const commit = process.env.NEXT_PUBLIC_COMMIT_HASH;
|
||||||
|
|
||||||
|
return <div>{commit}</div>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default HealthPage;
|
||||||
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user