Menu

πŸ“°
0

Deploying Flutter Web to Firebase Hosting with GitHub Actions CI/CD

DEV Community: firebaseΒ·kanta13jp1Β·about 1 month ago
#oiopP9Zd
#dev#firebase#ci#buildinpublic#webdev#class
Reading 0:00
15s threshold

Deploying Flutter Web to Firebase Hosting with GitHub Actions CI/CD Why Firebase Hosting? Option Pros Cons Firebase Hosting Free, auto-HTTPS, CDN, easy GitHub Actions Google dependency Vercel Feature-rich Flutter-specific config is complex GitHub Pages Free Manual HTTPS setup For Flutter Web, Firebase Hosting is the fastest path to production. 1. Firebase CLI Setup npm install -g firebase-tools firebase login cd your-flutter-project firebase init hosting Answer firebase init hosting : Public directory: build/web Configure as SPA: Yes Automatic builds via GitHub: No (we'll configure manually) 2. firebase.json Configuration { "hosting" : { "public" : "build/web" , "ignore" : [ "firebase.json" , "**/.*" , "**/node_modules/**" ], "rewrites" : [ { "source" : "**" , "destination" : "/index.html" } ], "headers" : [ { "source" : "**/*.@(js|css|wasm)" , "headers" : [ { "key" : "Cache-Control" , "value" : "max-age=31536000" } ] } ] } } rewrites β†’ all routes serve index.html (required for Flutter's client-side router).…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More