Deployment - nightillusions/react-firebase-material-admin GitHub Wiki
Deploying the app to Firebase
2. Install Firebase CLI and authenticate (firebase login
)
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"
};
- Copy the workflow
main.yml
from /.github/workflows/main.yml
- Setup your repository
Secrets
under repository settings: FIREBASE_TOKEN
, PROJECT_ID
- Commit to
master