Skip to content

Commit

Permalink
Merge pull request #263 from valerymelou/chore/google-analytics
Browse files Browse the repository at this point in the history
chore: setup Google Analytics for the prod environment
  • Loading branch information
valerymelou authored Jul 31, 2024
2 parents a0eceb6 + 98d1bce commit 927bcdf
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
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>

0 comments on commit 927bcdf

Please sign in to comment.