Skip to content

Commit 6fb4e52

Browse files
committed
fix: Update CI/CD workflow for two-project Firebase deployment
- Remove multi-site targets in favor of two separate Firebase projects - Update firebase.json to single-site configuration for Storybook - Add entryPoint parameter for demo deployment - Update documentation to reflect two-project approach - Fixes deployment error: "Deploy target docs not configured"
1 parent d73b0b6 commit 6fb4e52

4 files changed

Lines changed: 53 additions & 70 deletions

File tree

.github/workflows/README.md

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,44 @@ The `deploy.yml` workflow automatically deploys both Storybook documentation and
88

99
### Required Setup
1010

11-
Before the workflow can run successfully, you need to configure the Firebase service account secret:
11+
Before the workflow can run successfully, you need to configure two Firebase service account secrets:
1212

13-
1. **Generate Firebase Service Account Key:**
14-
```bash
15-
# Login to Firebase CLI
16-
firebase login
13+
1. **Generate Firebase Service Account Keys:**
1714

18-
# Create a service account key
19-
firebase init hosting:github
20-
```
15+
For the Storybook project (`premium-react-loaders`):
16+
- Go to Firebase Console → Project Settings → Service Accounts
17+
- Click "Generate New Private Key"
18+
- Save the JSON file securely
2119

22-
Or manually create one from the Firebase Console:
23-
- Go to Project Settings > Service Accounts
20+
For the Demo project (`premium-react-loaders-demo`):
21+
- Go to Firebase Console → Project Settings Service Accounts
2422
- Click "Generate New Private Key"
2523
- Save the JSON file securely
2624

27-
2. **Add Secret to GitHub Repository:**
25+
2. **Add Secrets to GitHub Repository:**
2826
- Go to your GitHub repository
2927
- Navigate to Settings > Secrets and variables > Actions
30-
- Click "New repository secret"
31-
- Name: `FIREBASE_SERVICE_ACCOUNT`
32-
- Value: Paste the entire contents of the service account JSON file
33-
- Click "Add secret"
28+
- Create two secrets:
3429

35-
### Firebase Multi-Site Configuration
30+
**Secret 1:**
31+
- Name: `FIREBASE_SERVICE_ACCOUNT_PREMIUM_REACT_LOADERS`
32+
- Value: Contents of the Storybook project service account JSON
3633

37-
The project uses Firebase multi-site hosting with two targets:
34+
**Secret 2:**
35+
- Name: `FIREBASE_SERVICE_ACCOUNT_PREMIUM_REACT_LOADERS_DEMO`
36+
- Value: Contents of the demo project service account JSON
3837

39-
- **`docs`** target → Deploys Storybook to `docs.premium-react-loaders.ishansasika.dev`
40-
- Build output: `storybook-static/`
41-
42-
- **`demo`** target → Deploys demo app to `premium-react-loaders.ishansasika.dev`
43-
- Build output: `demo/dist/`
38+
### Firebase Project Configuration
4439

45-
To configure the hosting targets locally:
40+
The project uses two separate Firebase projects:
4641

47-
```bash
48-
# Apply hosting targets to your Firebase sites
49-
firebase target:apply hosting docs <your-docs-site-id>
50-
firebase target:apply hosting demo <your-demo-site-id>
51-
```
42+
- **`premium-react-loaders`** → Deploys Storybook to `docs.premium-react-loaders.ishansasika.dev`
43+
- Configuration: Root `firebase.json` and `.firebaserc`
44+
- Build output: `storybook-static/`
5245

53-
These targets are referenced in `firebase.json` and the GitHub Actions workflow.
46+
- **`premium-react-loaders-demo`** → Deploys demo app to `premium-react-loaders.ishansasika.dev`
47+
- Configuration: `demo/firebase.json` and `demo/.firebaserc`
48+
- Build output: `demo/dist/`
5449

5550
### Workflow Trigger
5651

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ jobs:
4646
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PREMIUM_REACT_LOADERS_DEMO }}'
4747
projectId: premium-react-loaders-demo
4848
channelId: live
49+
entryPoint: demo

CLAUDE.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,25 +139,30 @@ Components support a `testId` prop for test targeting. When provided, it's appli
139139

140140
## Firebase Deployment
141141

142-
Both Storybook and the demo app are deployed to Firebase Hosting using multi-site configuration:
142+
Both Storybook and the demo app are deployed to Firebase Hosting using two separate Firebase projects:
143143

144144
- **Storybook**: https://docs.premium-react-loaders.ishansasika.dev/ (component documentation)
145-
- **Demo App**: https://premium-react-loaders.ishansasika.dev/ (interactive playground)
146-
147-
### Multi-Site Configuration
145+
- Firebase project: `premium-react-loaders`
146+
- Configuration: Root `firebase.json` and `.firebaserc`
147+
- Build output: `storybook-static/`
148148

149-
The root `firebase.json` defines two hosting targets:
150-
- `docs` target → Deploys `storybook-static/` to docs subdomain
151-
- `demo` target → Deploys `demo/dist/` to main domain
149+
- **Demo App**: https://premium-react-loaders.ishansasika.dev/ (interactive playground)
150+
- Firebase project: `premium-react-loaders-demo`
151+
- Configuration: `demo/firebase.json` and `demo/.firebaserc`
152+
- Build output: `demo/dist/`
152153

153154
### CI/CD with GitHub Actions
154155

155156
Automated deployments are configured via `.github/workflows/deploy.yml`:
156157
- Triggers on push to `main` branch
157158
- Builds both Storybook and demo app
158-
- Deploys both sites to Firebase Hosting
159+
- Deploys both to their respective Firebase projects
160+
161+
**Required Secrets**: Two GitHub repository secrets must be configured:
162+
- `FIREBASE_SERVICE_ACCOUNT_PREMIUM_REACT_LOADERS` (for Storybook)
163+
- `FIREBASE_SERVICE_ACCOUNT_PREMIUM_REACT_LOADERS_DEMO` (for demo app)
159164

160-
**Required Secret**: `FIREBASE_SERVICE_ACCOUNT` must be configured in GitHub repository secrets. See `.github/workflows/README.md` for setup instructions.
165+
See `.github/workflows/README.md` for detailed setup instructions.
161166

162167
## Demo App Architecture
163168

firebase.json

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
11
{
2-
"hosting": [
3-
{
4-
"target": "docs",
5-
"public": "storybook-static",
6-
"ignore": [
7-
"firebase.json",
8-
"**/.*",
9-
"**/node_modules/**"
10-
],
11-
"rewrites": [
12-
{
13-
"source": "**",
14-
"destination": "/index.html"
15-
}
16-
]
17-
},
18-
{
19-
"target": "demo",
20-
"public": "demo/dist",
21-
"ignore": [
22-
"firebase.json",
23-
"**/.*",
24-
"**/node_modules/**"
25-
],
26-
"rewrites": [
27-
{
28-
"source": "**",
29-
"destination": "/index.html"
30-
}
31-
]
32-
}
33-
]
2+
"hosting": {
3+
"public": "storybook-static",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
],
9+
"rewrites": [
10+
{
11+
"source": "**",
12+
"destination": "/index.html"
13+
}
14+
]
15+
}
3416
}

0 commit comments

Comments
 (0)