🚀 Complete Project Setup Guide
Step-by-step instructions to deploy an Astro + Firebase website with automated GitHub Actions CI/CD
⏱️ Estimated time: 30-45 minutes
📋 Prerequisites
Required Accounts
Required Software
- • Cursor or VS Code
- • Node.js 18+
- • Git
- • Firebase CLI
Download & Setup Template
Actions to take:
- Go to vibecoding.cc
- Download the Astro + Firebase template
- Extract files to your project folder
- Open the project folder in Cursor (File → Open Folder)
- Open the Terminal panel in Cursor (View → Terminal or
Ctrl+`)
✅ Checkpoint: You should have the project folder open in Cursor with Astro files visible in the file explorer
Initialize Git Repository
Initialize Git (in Cursor terminal):
Verify .gitignore file:
Make sure your project has a proper .gitignore file that excludes:
node_modules/dist/.env.astro/.DS_Store
The VibeCoding template should include this automatically, but verify it exists in your project root.
Create GitHub repository and connect (using Cursor UI):
- Go to GitHub.com and create a new repository
- In Cursor, open the Source Control panel (View → Source Control or
Ctrl+Shift+G) - Click the "+" button next to files to stage them (or click the "+" next to "Changes" to stage all)
- Type commit message:
"Initial commit" - Click "Commit" button
- Click "Publish Branch" button
- Select "GitHub" as remote
- Choose your repository and click "Publish"
✅ Checkpoint: Code is pushed to GitHub repository
Create Firebase Project
Actions to take:
- Go to Firebase Console
- Click "Create a project"
- Enter project name (e.g., "prj-setup-guide")
- Enable Google Analytics (optional)
- Click "Create project"
- Go to "Hosting" in the left sidebar
- Click "Get started"
✅ Checkpoint: Firebase project created with Hosting enabled
Initialize Firebase in Project
Run these commands in Cursor/VS Code terminal:
⚠️ Important: When prompted:
- Select "Hosting"
- Choose "Use an existing project"
- Select your Firebase project
- Set public directory to "dist"
- Configure as single-page app: Yes
- Set up automatic builds: Yes
- Choose GitHub repository
- Select "Deploy on merge"
⚠️ Important: This process does NOT automatically add service account keys to GitHub. You'll need to manually add the service account key in the next step.
✅ Checkpoint: Firebase initialized with GitHub Actions workflow
Configure Environment Variables
Create .env file:
Get Firebase config from Console:
- Go to Project Settings → General
- Scroll down to "Your apps"
- Click "Web app" icon
- Copy the config values to your .env file
✅ Checkpoint: .env file configured with Firebase credentials
Set Up GitHub Secrets
Add Firebase Service Account Key:
- Go to Firebase Console → Project Settings → Service Accounts
- Click "Generate new private key" and download the JSON file
- Go to GitHub repository → Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
FIREBASE_SERVICE_ACCOUNT_KEY - Value: Copy and paste the entire JSON content from the downloaded file
- Click "Add secret"
Add Environment Variables as Secrets:
Also add these repository secrets (from your .env file):
VITE_FIREBASE_API_KEYVITE_FIREBASE_AUTH_DOMAINVITE_FIREBASE_PROJECT_IDVITE_FIREBASE_MESSAGING_SENDER_IDVITE_FIREBASE_APP_ID
✅ Checkpoint: All secrets configured in GitHub
Test & Deploy
Test locally first (in Cursor/VS Code terminal):
Visit http://localhost:4321 to preview your site in development mode
Test production build:
Visit http://localhost:5002 to preview the production build
Deploy to production (using Cursor Git panel):
- Open the Source Control panel in Cursor (View → Source Control or
Ctrl+Shift+G) - Stage all changes by clicking the "+" next to "Changes"
- Type commit message:
"Configure deployment" - Click "Commit" button
- Click the "Sync Changes" button (or "Push" if available)
This will trigger the GitHub Actions workflow and deploy your site!
✅ Checkpoint: Website deployed and accessible via Firebase URL
Verify Deployment
Check these items:
- GitHub Actions workflow completed successfully
- Firebase Hosting shows your deployed site
- Website loads correctly at Firebase URL (e.g.,
https://prj-setup-guide.web.app) - All pages and features work as expected
🎉 Success! Your website is live with automated CI/CD!
🎯 Next Steps (Optional)
Immediate
- • Set up custom domain via Firebase Console
- • Configure Cloudflare DNS settings
- • Add SSL certificate (automatic with Firebase)
Cursor/VS Code Enhancements
- • Install useful Cursor extensions (Astro, Tailwind, Firebase)
- • Install npm metacoding package:
npm install -g @metacoding/cli - • Create more pages using Cursor's AI assistance
- • Use Cursor's AI to generate components
- • Set up Cursor workspace settings for the project
Future Development
- • Add Firebase Authentication
- • Implement Firestore database
- • Set up analytics and monitoring
- • Add more interactive features
🔧 Troubleshooting
Build fails in GitHub Actions
Check that all environment variables are set correctly in repository secrets
Firebase deployment fails
Verify service account key is valid and has proper permissions
Website shows blank page
Check that Firebase hosting is pointing to 'dist' directory, not 'public'