Skip to content

Commit c6cf844

Browse files
committed
Document the need to update Firebase rules directly (not automated in CI)
1 parent 2676786 commit c6cf844

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ jobs:
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

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
158161
1. Firebase Console → **Realtime Database → Rules** tab
159162
2. Replace everything with the contents of [`firebase-rules.json`](firebase-rules.json)
160163
3. 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

0 commit comments

Comments
 (0)