I've been doing a React+Firebase project without any CI/CD, and the manual effort has become unpleasant, so I'm looking to automate deployment to 2 environments, but not sure how to it with Firebase.
I have 2 environments - test and prod, each pointing to a separate Firebase project and database. Currently depending on where I deploy, I just alternate between config and configTest:
const configTest = {
apiKey: "XXX",
authDomain: "domaintest.firebaseapp.com",
databaseURL: "https://domaintest.firebaseio.com",
projectId: "domain-test",
storageBucket: "domaintest.appspot.com",
messagingSenderId: "000"
};
const config = {
apiKey: "YYY",
authDomain: "domain.firebaseapp.com",
databaseURL: "https://domain.firebaseio.com",
projectId: "domain",
storageBucket: "domain.appspot.com",
messagingSenderId: "111"
};
firebase.initializeApp(config);
//firebase.initializeApp(configTest);
I am assuming there should be a better way, but I couldn't find any instruction on the topic.