Skip to content

Commit a1f178b

Browse files
committed
ci: deploy to GitHub Pages
1 parent 8eaca3a commit a1f178b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

docusaurus.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ import versions from './versions.json';
1313

1414
const isDev = process.env.NODE_ENV === 'development';
1515
const isBuildFast = isDev || !!process.env.BUILD_FAST;
16-
const isNetlify = !!process.env.NETLIFY;
17-
const isProd = isNetlify && process.env.CONTEXT === 'production';
16+
const isProd =
17+
process.env.CURRENT_BRANCH === 'main' && process.env.CONTEXT === 'production';
1818

1919
const config: Config = {
20+
organizationName: 'someengineering',
21+
projectName: 'inventory.fix.security',
22+
deploymentBranch: 'gh-pages',
2023
title: 'Fix Inventory by Some Engineering Inc.',
2124
url: 'https://inventory.fix.security',
2225
baseUrl: '/',
@@ -29,14 +32,13 @@ const config: Config = {
2932
noIndex: !isProd,
3033
customFields: {
3134
isDev,
32-
isNetlify,
3335
isProd,
3436
posthogProjectApiKey: process.env.POSTHOG_PROJECT_API_KEY,
3537
},
3638
scripts: isProd
3739
? [
3840
{
39-
src: 'https://inventory.fix.security/js/script.js',
41+
src: 'https://plausible.io/js/script.js',
4042
defer: true,
4143
'data-domain': 'inventory.fix.security',
4244
},

src/providers/posthog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export default function PosthogProvider({
1010
}) {
1111
const {
1212
siteConfig: {
13-
customFields: { isDev, isNetlify, isProd, posthogProjectApiKey },
13+
customFields: { isDev, isProd, posthogProjectApiKey },
1414
},
1515
} = useDocusaurusContext();
1616

1717
useEffect(() => {
1818
if (posthogProjectApiKey && !posthog.__loaded) {
1919
posthog.init(posthogProjectApiKey as string, {
20-
api_host: isNetlify ? '/api/ingest' : 'https://eu.posthog.com',
20+
api_host: 'https://eu.posthog.com',
2121
ui_host: 'https://eu.posthog.com',
2222
cross_subdomain_cookie: !!isProd,
2323
secure_cookie: !!isNetlify,
@@ -33,7 +33,7 @@ export default function PosthogProvider({
3333
enable_recording_console_log: false,
3434
});
3535
}
36-
}, [isDev, isNetlify, isProd, posthogProjectApiKey]);
36+
}, [isDev, isProd, posthogProjectApiKey]);
3737

3838
return <Provider client={posthog}>{children}</Provider>;
3939
}

0 commit comments

Comments
 (0)