Revert "chore: cleanup env variable"

This reverts commit 9c480825a8.
pull/3242/merge
liliced 2024-12-10 14:33:15 +01:00
parent 9c480825a8
commit 784fbb6484
3 changed files with 7 additions and 2 deletions

View File

@ -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}}-

View File

@ -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"

View File

@ -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,