Deploy tự động như Vercel - Nhưng miễn phí hơn
Firebase App Hosting là giải pháp deploy Next.js/Nuxt.js với tính năng tương đương Vercel, tích hợp sâu với Firebase ecosystem.
Tại sao chọn Firebase App Hosting thay vì Vercel?
- Tích hợp native với Firestore, Auth, Functions
- Pricing minh bạch hơn (không surprise billing)
- Cùng hệ sinh thái Google Cloud
Bước triển khai:
- Chuẩn bị project Next.js:
npx create-next-app@latest my-vibe-app
cd my-vibe-app
- Khởi tạo Firebase App Hosting:
firebase experiments:enable webframeworks
firebase init hosting
# Chọn: "Use an existing Firebase project"
# Chọn framework: "Next.js"
- Kết nối GitHub repo:
- Firebase Console > App Hosting > "Get Started"
- Authorize GitHub
- Chọn repository
- Thiết lập branch trigger (main/production)
- Cấu hình build settings:
# apphosting.yaml
runConfig:
cpu: 1
memory: 512Mi
concurrency: 80
env:
- variable: NEXT_PUBLIC_FIREBASE_API_KEY
secret: firebase-api-key
- Push code và xem magic:
git add .
git commit -m "feat: initial deployment"
git push origin main
Kết quả:
- Mỗi push lên main = auto deploy
- Preview deployments cho Pull Requests
- Rollback 1-click nếu có lỗi
