From 784fbb64841fc0e00cc68a9a4723e0f392b7321d Mon Sep 17 00:00:00 2001 From: liliced <35871521+liliced@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:33:15 +0100 Subject: [PATCH] Revert "chore: cleanup env variable" This reverts commit 9c480825a8a21c66e27110bc917a903d0c8b7c3f. --- .github/workflows/deploy.yaml | 2 +- site/.env.template | 1 + site/source/components/Provider.tsx | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 262c1b4af..3c792c143 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -60,7 +60,7 @@ jobs: run: yarn workspace site build env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - VITE_AT_INTERNET_SITE_ID: ${{ vars.VITE_AT_INTERNET_SITE_ID }} + VITE_AT_INTERNET_SITE_ID: ${{ needs.deploy-context.outputs.env-name == 'master' && 617190 || 617189 }} VITE_ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} VITE_ALGOLIA_SEARCH_KEY: ${{secrets.ALGOLIA_SEARCH_KEY}} VITE_ALGOLIA_INDEX_PREFIX: monentreprise-${{needs.deploy-context.outputs.env-name}}- diff --git a/site/.env.template b/site/.env.template index 2723f7002..409e6c59e 100644 --- a/site/.env.template +++ b/site/.env.template @@ -16,6 +16,7 @@ VITE_ALGOLIA_APP_ID= VITE_ALGOLIA_SEARCH_KEY= VITE_ALGOLIA_INDEX_PREFIX=monentreprise-master- VITE_AT_INTERNET_SITE_ID= +VITE_AT_INTERNET_DEV_SITE_ID= VITE_FR_BASE_URL="http://localhost:3000/mon-entreprise" VITE_EN_BASE_URL="http://localhost:3000/infrance" diff --git a/site/source/components/Provider.tsx b/site/source/components/Provider.tsx index 5704ac5cc..25c396135 100644 --- a/site/source/components/Provider.tsx +++ b/site/source/components/Provider.tsx @@ -117,7 +117,11 @@ function TrackingProvider({ children }: { children: React.ReactNode }) { script.async = true script.onload = () => { - const siteId = import.meta.env.VITE_AT_INTERNET_SITE_ID + const siteId = ( + !import.meta.env.SSR + ? import.meta.env.VITE_AT_INTERNET_SITE_ID + : import.meta.env.VITE_AT_INTERNET_DEV_SITE_ID + ) as string const ATTrackerClass = createTracker( siteId,