Skip to content

Commit

Permalink
renamed Google Analytics environment variable & passed it through to …
Browse files Browse the repository at this point in the history
…Docker 🧫
  • Loading branch information
dysbulic committed Nov 24, 2023
1 parent 27832ee commit 70fa9cd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/gcp-deploy-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ jobs:
YOUTUBE_API_KEY=${{secrets.YOUTUBE_API_KEY}}
IMGIX_TOKEN=${{secrets.IMGIX_TOKEN}}
HONEYBADGER_API_KEY=${{secrets.HONEYBADGER_API_KEY}}
GOOGLE_ANALYTICS_ID=${{secrets.GOOGLE_ANALYTICS_ID}}
USERBACK_TOKEN=${{secrets.USERBACK_TOKEN}}
WEB3_STORAGE_TOKEN=${{secrets.WEB3_STORAGE_TOKEN}}
OPENSEA_API_KEY=${{secrets.OPENSEA_API_KEY}}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/gcp-deploy-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ env:
HASURA_PORT: 8080
FRONTEND_PORT: 3000
HASURA_SECRET: metagame_secret
GA4_ID: G-B1NKK3Q1BP
APP_ENV: development

jobs:
Expand Down
2 changes: 2 additions & 0 deletions docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ARG FRONTEND_URL https://metagame.wtf
ARG IMGIX_TOKEN
ARG YOUTUBE_API_KEY
ARG HONEYBADGER_API_KEY
ARG GOOGLE_ANALYTICS_ID
ARG USERBACK_TOKEN
ARG CERAMIC_URL https://ceramic.metagame.wtf
ARG WEB3_STORAGE_TOKEN
Expand All @@ -64,6 +65,7 @@ ENV NEXT_PUBLIC_FRONTEND_URL $FRONTEND_URL
ENV NEXT_PUBLIC_IMGIX_TOKEN $IMGIX_TOKEN
ENV NEXT_PUBLIC_YOUTUBE_API_KEY $YOUTUBE_API_KEY
ENV NEXT_PUBLIC_HONEYBADGER_API_KEY $HONEYBADGER_API_KEY
ENV NEXT_PUBLIC_GOOGLE_ANALYTICS_ID $GOOGLE_ANALYTICS_ID
ENV NEXT_PUBLIC_USERBACK_TOKEN $USERBACK_TOKEN
ENV NEXT_PUBLIC_CERAMIC_URL $CERAMIC_URL
ENV NEXT_PUBLIC_GCAL_CALENDAR_ID $GCAL_CALENDAR_ID
Expand Down
2 changes: 1 addition & 1 deletion packages/web/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const CONFIG = {
brightIdNodeURL:
process.env.NEXT_BRIGHTID_NODE_URL || 'http:%2f%2fnode.brightid.org',
publicURL: process.env.NEXT_PUBLIC_FRONTEND_URL,
gaId: process.env.NEXT_PUBLIC_GA4_ID,
gaId: process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID,
honeybadgerAPIKey: process.env.NEXT_PUBLIC_HONEYBADGER_API_KEY,
get useHoneybadger() {
return this.appEnv === 'production' && !!this.honeybadgerAPIKey;
Expand Down
8 changes: 3 additions & 5 deletions packages/web/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ import PlausibleProvider from 'next-plausible';
import { WithUrqlProps } from 'next-urql';
import React from 'react';

const { userbackToken, honeybadgerAPIKey, gaId } = CONFIG;
const { userbackToken, honeybadgerAPIKey, gaId, appEnv } = CONFIG;

const Analytics: React.FC = () => {
// console.log('CONFIG', gaId);

if (!gaId) {
if (!gaId || appEnv !== 'production') {
return null;
}
return (
Expand Down Expand Up @@ -67,7 +65,7 @@ const App: React.FC<WithUrqlProps> = ({
justifyContent: 'center',
}}
>
<Image src={Animocto.src} alt="Loading..." height={250} width={250} />
<Image src={Animocto.src} alt="Loading" height={250} width={250} />
<style jsx global>{`
body {
margin: 0;
Expand Down
5 changes: 3 additions & 2 deletions packages/web/pages/learn/playbooks/[questchain].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,11 @@ export const getStaticProps = async (
let questChain: graphql.QuestChainInfoFragment | null = null;
try {
const info = QuestChainPlaybooksDetails[questchain];
if (!info) {
throw new Error(`Quest chain ${questchain} not found!`);
}
questChain = await getQuestChainInfo(info.chainId, info.address);
} catch (error) {
// eslint-disable-next-line no-console

errorHandler(error as Error);
}

Expand Down

0 comments on commit 70fa9cd

Please sign in to comment.