Tarun Singh
Tarun Singh

Reputation: 480

Firebase Hosting and Github Action error "auth/invalid-api-key"

I'm using React for my project along with Firebase. Using Github Actions my code is successfully deployed to firebase.
But when I visit the hosted URL It gives me an error in the console saying

"Your API key is invalid, please check you have copied it correctly."

However when I deploy from the local system directly using firebase deploy It works fine.

I have taken the required care of my environment variables. But nothing seems to work.

It seems there is some problem while GitHub actions deploy the changes to firebase.
Though all the build pass it gives me an error as stated above. Please Help.
enter image description here

Upvotes: 4

Views: 1658

Answers (1)

Filipe Mota
Filipe Mota

Reputation: 11

This happen because GitHub actions don't have access to your .env on your local machine, you need to configure that on "GitHub Secrets" and put on your yml file.

Upvotes: 1

Related Questions