Skip to content

Commit

Permalink
PLEASE WORK .ENV!!
Browse files Browse the repository at this point in the history
  • Loading branch information
Niceygy committed Dec 13, 2023
1 parent 04b6ac3 commit 0e38ff9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: yarn && yarn add vercel
run: npm i vercel

- name: Add firefile
run: echo ${{ secrets.FIREFILE }} >> ./firebase.json && ls
Expand All @@ -34,4 +34,4 @@ jobs:
# run: yarn run build

- name: Deploy
run: vercel --token ${{ secrets.VERCEL_AUTH }} --yes
run: vercel --token ${{ secrets.VERCEL_AUTH }} --yes -e NODE_ENV=production
5 changes: 2 additions & 3 deletions src/pages/api/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import { getFirestore } from "firebase/firestore";
import log from "../api/log";
export const runtime = 'edge';
let fireFile;
console.log(process.env.E)


try {
fireFile = require("../../../firebase.json"); //yes viggo i need to use require ;)
} catch (error) {
fireFile = {};
}
console.log(fireFile)
let firebaseConfig;

if (process.env.E != null) {
if (process.env.NODE_ENV === "production") {
console.log("Using production environment", "firefile")
// In a production environment, use environment variables
firebaseConfig = {
Expand Down

0 comments on commit 0e38ff9

Please sign in to comment.