Build & Deploy
Guide to building a production bundle and deploying Asset Information Centre.
Production build
# 1. Ensure .env has production Firebase config
npm run build
This runs:
tsc— TypeScript type checkingvite build— optimized bundle todist/
Output:
dist/
├── index.html
├── assets/
│ ├── index-[hash].js
│ └── index-[hash].css
└── favicon.png
Preview locally
npm run preview
Serves dist/ at http://localhost:4173 (default).
Environment for production
Set VITE_* variables before npm run build. They are embedded at compile time.
CI/CD example (GitHub Actions):
- name: Build
env:
VITE_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
VITE_FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
VITE_FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
VITE_FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
VITE_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
VITE_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
run: npm run build
Deploy checklist
- Production Firebase project configured
- Firestore rules deployed
- Firestore indexes deployed
- Auth authorized domains updated
- Super Admin user created
-
.env/ CI secrets set correctly -
npm run buildsucceeds - HTTPS enabled on hosting domain
Post-deploy
- Log in as Super Admin
- Verify Settings → Firebase connection
- Deploy rules if not done:
firebase deploy --only firestore:rules - Test SSO redirect URIs on production domain