Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup Google Analytics for the prod environment #263

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# Generate the routes for prerendering. This is the only way I found to pass
# environment variables to the executor.
- run: VM_CONTENTFUL_SPACE=${{ env.VM_CONTENTFUL_SPACE }} VM_CONTENTFUL_ACCESS_TOKEN=${{ env.VM_CONTENTFUL_ACCESS_TOKEN }} VM_CONTENTFUL_ENVIRONMENT=${{ env.VM_CONTENTFUL_ENVIRONMENT }} yarn nx run website:build-routes
- run: npx nx run website:prerender
- run: npx nx run website:prerender:${{ env.VM_CONTENTFUL_ENVIRONMENT }}

- name: Archive artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -98,4 +98,3 @@ jobs:
channelId: live
projectId: ${{ secrets.FIREBASE_PROJECT_ID }}
target: ${{ secrets.FIREBASE_SITE_TARGET }}

23 changes: 23 additions & 0 deletions apps/website/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all",
"index": "apps/website/src/index.prod.html"
},
"staging": {
"budgets": [
{
"type": "initial",
Expand Down Expand Up @@ -96,6 +112,9 @@
"production": {
"outputHashing": "media"
},
"staging": {
"outputHashing": "media"
},
"development": {
"buildOptimizer": false,
"optimization": false,
Expand Down Expand Up @@ -134,6 +153,10 @@
"production": {
"browserTarget": "website:build:production",
"serverTarget": "website:server:production"
},
"staging": {
"browserTarget": "website:build:staging",
"serverTarget": "website:server:staging"
}
},
"defaultConfiguration": "production"
Expand Down
39 changes: 39 additions & 0 deletions apps/website/src/index.prod.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!doctype html>
<html lang="en" class="dark scroll-smooth lg:overflow-y-scroll">
<head>
<meta charset="utf-8" />
<title>Valery Melou</title>
<base href="/" />
<meta
name="description"
content="Web developer from Yaounde Cameroon. Crafting beautiful, interactive and accessible experiences for the web and the mobile."
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap"
rel="stylesheet"
/>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-JX8BS8T4LG"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());

gtag('config', 'G-JX8BS8T4LG');
</script>
</head>
<body
class="font-body dark:bg-dark bg-white leading-relaxed tracking-wide text-slate-900 dark:text-slate-400"
>
<app-root></app-root>
</body>
</html>