Deployment - nightillusions/react-firebase-material-admin GitHub Wiki

Deploying the app to Firebase

1. Create a new Firebase project

2. Install Firebase CLI and authenticate (firebase login)

3. Setup Auth-Methods Google and Facebook

4. Setup the firestore and add your first collection users with a fake user:

{
  "firstName": "John",
  "lastName": "Smith",
  "email": "[email protected]"
}

5. Change the firestore security to this:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if false;
    }
    match /users/{userId} {
      allow read, update, delete: if request.auth.uid == userId;
      allow create: if request.auth.uid != null;
    }
  }
}

6. Setup Storage and create the folder users

7. Go to your firebase console and grap your firebase SDK config an replace it in /src/app/firebase/firebase.ts

const firebaseConfig = {
  apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  authDomain: "xxxxxx.firebaseapp.com",
  databaseURL: "https://xxxxxx.firebaseio.com",
  projectId: "xxxxxx",
  storageBucket: "xxxxxx.appspot.com",
  messagingSenderId: "xxxxxx",
  appId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  measurementId: "xxxxxx"
};

8. Setup your repository GitHub Actions:

  1. Copy the workflow main.yml from /.github/workflows/main.yml
  2. Setup your repository Secrets under repository settings: FIREBASE_TOKEN, PROJECT_ID
  3. Commit to master