How does Dev-Prod workflow work for Firebase-React App using GitHub Workflow?

Viewed 33

I have few doubts/clarifications that are specific to hosting a React App on Firebase:

  1. Assuming I have 2 firebase projects(dev and prod), where do I store the API keys for both the projects? In the App.js file, a separate env file, or somewhere else?
  2. During the development process, how do I switch between dev project and prod project for the same code?
  3. Let's say I am in a scenario where I want to use the dev project's firestore from my dev branch, add a feature and test it, then want to test the same feature on the firestore contents of prod project without risking the modification of prod project data, is there a way to achieve this?

I have been using the following video as a reference "Shipping production web apps on Firebase Hosting" but due to doubt number (1), am unable to proceed. At 6:00 in the video, the env files are added and I wasn't sure if this is where the API keys go.

Any help/assistance is appreciated. Please let me know if any more details needs to be shared.

0 Answers
Related