File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 - name : Validate Firebase rules JSON
3333 run : npm run validate:rules:json
3434
35- - name : Validate Firebase rules syntax
35+ - name : Validate Firebase rules syntax and smoke test
36+ # Validates firebase-rules.json syntax and runs behavioral smoke tests against
37+ # the Firebase Database Emulator. This does NOT deploy the rules to the live
38+ # Firebase project. After merging changes to firebase-rules.json, deploy manually:
39+ # npx firebase-tools deploy --only database --project YOUR_PROJECT_ID
40+ # Automating deployment here would require a Firebase service-account secret in
41+ # GitHub Actions — see README Step 7 for instructions.
3642 run : npm run validate:rules
3743
3844 - name : Build app
Original file line number Diff line number Diff line change @@ -155,10 +155,24 @@ VITE_INSTRUCTOR_PASSWORD=your_password_here
155155
156156### Step 7 — Set Firebase security rules
157157
158+ The file [ ` firebase-rules.json ` ] ( firebase-rules.json ) defines who can read and
159+ write each part of the database.
160+
1581611 . Firebase Console → ** Realtime Database → Rules** tab
1591622 . Replace everything with the contents of [ ` firebase-rules.json ` ] ( firebase-rules.json )
1601633 . Click ** Publish**
161164
165+ Note that the CI pipeline valideas the rules but does not deploy them automatically.
166+ Whenever the rules change, they must be deployed to the Firebase project directly.
167+
168+ To do this from the Firebase CLI:
169+ ``` bash
170+ npx firebase-tools login
171+ npx firebase-tools deploy --only database --project YOUR_PROJECT_ID
172+ ```
173+ Replace ` YOUR_PROJECT_ID ` with the Firebase project ID from your ` .env.local `
174+ (` VITE_FIREBASE_PROEJCT_ID ` ).
175+
162176### Step 8 — Test locally
163177
164178``` bash
You can’t perform that action at this time.
0 commit comments