'How to get env variables into github CICD?
I have a firebase config object where the values are in my .env file (the .env file is not committed to github)
const firebaseConfig = {
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
projectId: process.env.FIREBASE_PROJECT_ID,
...
};
In Github CICD, when running the tests, it's failing because there is no .env file so the values for firebaseConfig are all undefined. What is the best way tackle this problem?
The fail output:
FAIL src/components/favoritesPage/FavoritesPage.test.tsx
● Test suite failed to run
FirebaseError: Firebase: Error (auth/invalid-api-key).
19 | import { routes } from "../Navigation/Routes";
20 |
> 21 | const auth = getAuth(app);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
