From 173eb876e71a67105102dcbcbf644b49e9ce5dce Mon Sep 17 00:00:00 2001 From: Al Mithani Date: Mon, 16 Dec 2024 19:47:44 -0500 Subject: [PATCH] trying to fix env vars --- .github/workflows/static.yml | 9 ++++----- src/data/env.tsx | 14 +++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 235e773..ff6c6b3 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -37,15 +37,14 @@ jobs: cache: 'npm' - name: Install dependencies run: npm install + - name: Verify env variables + run: | + echo "Checking for environment variables..." + echo "ALCHEMY_API_KEY exists: ${{ secrets.VITE_ALCHEMY_API_KEY != '' }}" - name: Build run: npm run build env: NODE_ENV: production - VITE_ARBITRUM_ALCHEMY_API_KEY: ${{ secrets.VITE_ARBITRUM_ALCHEMY_API_KEY }} - VITE_BASE_ALCHEMY_API_KEY: ${{ secrets.VITE_BASE_ALCHEMY_API_KEY }} - VITE_OP_ALCHEMY_API_KEY: ${{ secrets.VITE_OP_ALCHEMY_API_KEY }} - VITE_MATIC_ALCHEMY_API_KEY: ${{ secrets.VITE_MATIC_ALCHEMY_API_KEY }} - VITE_ETH_ALCHEMY_API_KEY: ${{ secrets.VITE_ETH_ALCHEMY_API_KEY }} VITE_ALCHEMY_API_KEY: ${{ secrets.VITE_ALCHEMY_API_KEY }} VITE_ELASTIC_EMAIL_PASSWORD: ${{ secrets.VITE_ELASTIC_EMAIL_PASSWORD }} VITE_ELASTICMAIL_SECURETOKEN: ${{ secrets.VITE_ELASTICMAIL_SECURETOKEN }} diff --git a/src/data/env.tsx b/src/data/env.tsx index 1655596..c0c0d74 100644 --- a/src/data/env.tsx +++ b/src/data/env.tsx @@ -1,5 +1,10 @@ // testing env vars -// console.log(import.meta.env); +console.log('Environment variables check:'); +console.log('ETH_ALCHEMY_API_KEY exists:', !!import.meta.env.VITE_ETH_ALCHEMY_API_KEY); +console.log('MATIC_ALCHEMY_API_KEY exists:', !!import.meta.env.VITE_MATIC_ALCHEMY_API_KEY); +console.log('OP_ALCHEMY_API_KEY exists:', !!import.meta.env.VITE_OP_ALCHEMY_API_KEY); +console.log('ARBITRUM_ALCHEMY_API_KEY exists:', !!import.meta.env.VITE_ARBITRUM_ALCHEMY_API_KEY); +console.log('BASE_ALCHEMY_API_KEY exists:', !!import.meta.env.VITE_BASE_ALCHEMY_API_KEY); export const REACT_APP_ALCHEMY_API_KEY = import.meta.env.VITE_REACT_APP_ALCHEMY_API_KEY export const ELASTICMAIL_SECURETOKEN = import.meta.env.VITE_ELASTICMAIL_SECURETOKEN @@ -7,12 +12,7 @@ export const ELASTICMAIL_SECURETOKEN = import.meta.env.VITE_ELASTICMAIL_SECURETO export const CONVERT_KIT_API_KEY = import.meta.env.VITE_CONVERT_KIT_API_KEY; export const CONVERT_KIT_FORM_ID = import.meta.env.VITE_CONVERT_KIT_FORM_ID; -export const ALCHEMY_API_KEY = import.meta.env.VITE_ALCHEMY_API_KEY; -export const ETH_ALCHEMY_API_KEY = import.meta.env.VITE_ETH_ALCHEMY_API_KEY; -export const MATIC_ALCHEMY_API_KEY = import.meta.env.VITE_MATIC_ALCHEMY_API_KEY; -export const OP_ALCHEMY_API_KEY = import.meta.env.VITE_OP_ALCHEMY_API_KEY; -export const ARBITRUM_ALCHEMY_API_KEY = import.meta.env.VITE_ARBITRUM_ALCHEMY_API_KEY; -export const BASE_ALCHEMY_API_KEY = import.meta.env.VITE_BASE_ALCHEMY_API_KEY; +export const ALCHEMY_API_KEY = import.meta.env.VITE_ALCHEMY_API_KEY; export const CG_API_KEY = import.meta.env.VITE_CG_API_KEY; // coingecko API key for pricing history lookups export const CG_API_URL = import.meta.env.VITE_CG_API_URL; // coingecko API url for pricing history lookups