Hi,
I want to add or run .env file in firebase using github action
here is what i did
.github/workflows/firebase-hosting-merge.yml
```
name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout
- run: npm ci && npm run build
- name: Load environment variables from .env file
run: |
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
fi
cat .env
- uses: FirebaseExtended/action-hosting-deploy
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{
secrets.FIREBASE_SERVICE_ACCOUNT_TEST_GOOGLE_PAGE }}
channelId: live
projectId: test-google-page
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
```
This is repo of github code enter image description here
- I have added .env in the root directory of github repo
- Everything is working fine even .env file is reading from above action but when i dont know whether its reading .env file or not and deployed into firebase account
Here is output where i need to show .env values reflected or not enter image description here so its not reflecting the values which im looking
cat .env
VUE_APP_API_URL=http://test.devops.com:3002/api/v1/xxxxxxx/xxxx
- actually values it need to show :- http://test.devops.com:3002/api/v1/xxxxxxx/xxxx
- current values showing :- http://localhost:3002/api/v1/xxxxxxx/xxxx
even i read this docs 5. https://firebase.google.com/docs/functions/config-env?gen=2nd#env-variables
But dont understand how to do
but in code of repo under subfolder i see this line
const apiEndpoint = process.env.SECURITY_AI_URL || "http://localhost:3002";
and i cannot change any code under repo of github because its client repo
please tell me what should i do to solve .env