
Firebase Hosting Basics
Deploy static sites, SPAs, and simple microservices to Firebase Hosting Classic with CDN, SSL, and preview channels—not App Hosting SSR.
Overview
Firebase Hosting Basics is an agent skill for the Ship phase that deploys static web apps and simple SPAs to Firebase Hosting Classic via CLI—not Firebase App Hosting.
Install
npx skills add https://github.com/firebase/agent-skills --skill firebase-hosting-basicsWhat is this skill?
- Firebase Hosting Classic: static HTML/CSS/JS, SPAs, and microservices via Cloud Functions or Cloud Run
- Global CDN on SSD edges, zero-config SSL, preview channels, GitHub Actions integration
- Explicit contrast: use Hosting not Firebase App Hosting for non-SSR React/Vue static builds
- Single-command deploy workflow with full CLI control over build output
- Do not use this skill when you need Next.js or Angular SSR via App Hosting
Adoption & trust: 73.9k installs on skills.sh; 345 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your static or SPA build is ready but you need a secure CDN host and preview workflow without misrouting into App Hosting for SSR frameworks.
Who is it for?
Indie devs shipping React, Vue, or plain static sites who want Firebase CDN, previews, and GitHub deploy hooks with CLI control.
Skip if: Next.js or Angular SSR/ISR on Firebase App Hosting, or teams that should use App Hosting per the skill’s explicit do-not-use guidance.
When should I use this skill?
Use when deploying static web apps, SPAs, or simple microservices to Firebase Hosting Classic; do not use for Firebase App Hosting or SSR frameworks per skill description.
What do I get? / Deliverables
Your agent configures Firebase Hosting, uses preview channels and deploy commands, and serves static or lightly dynamic content on SSL-backed CDN endpoints.
- Live or preview Firebase Hosting URL serving your build
- Documented hosting config and optional GitHub Actions deploy pipeline
Recommended Skills
Journey fit
Shipping a web app to production hosting is a core Ship phase milestone before public Launch. Launch subphase under Ship covers go-live deploy steps, preview URLs, and GitHub-driven releases described in the skill.
How it compares
Covers Firebase Hosting Classic static deploys, not Firebase App Hosting’s managed full-stack SSR pipelines.
Common Questions / FAQ
Who is firebase-hosting-basics for?
Solo builders and small teams deploying static or SPA frontends who want Firebase CDN hosting, SSL, and preview channels from the agent-assisted workflow.
When should I use firebase-hosting-basics?
During Ship when you deploy static web apps or simple SPAs, set up preview channels before go-live, or wire GitHub Actions—not when you need App Hosting for SSR frameworks.
Is firebase-hosting-basics safe to install?
It guides Firebase CLI deploys that touch your cloud project; review the Security Audits panel on this Prism page and IAM rules before granting the agent deploy access.
SKILL.md
READMESKILL.md - Firebase Hosting Basics
# hosting-basics This skill provides instructions and references for working with Firebase Hosting, a fast and secure hosting service for your web app, static and dynamic content, and microservices. ## Overview Firebase Hosting provides production-grade web content hosting for developers. With a single command, you can deploy web apps and serve both static and dynamic content to a global CDN (content delivery network). **Key Features:** - **Fast Content Delivery:** Files are cached on SSDs at CDN edges around the world. - **Secure by Default:** Zero-configuration SSL is built-in. - **Preview Channels:** View and test changes on temporary preview URLs before deploying live. - **GitHub Integration:** Automate previews and deploys with GitHub Actions. - **Dynamic Content:** Serve dynamic content and microservices using Cloud Functions or Cloud Run. ## Hosting vs App Hosting **Choose Firebase Hosting if:** - You are deploying a static site (HTML/CSS/JS). - You are deploying a simple SPA (React, Vue, etc. without SSR). - You want full control over the build and deploy process via CLI. **Choose Firebase App Hosting if:** - You are using a supported full-stack framework like Next.js or Angular. - You need Server-Side Rendering (SSR) or ISR. - You want an automated "git push to deploy" workflow with zero configuration. ## Instructions ### 1. Configuration (`firebase.json`) For details on configuring Hosting behavior, including public directories, redirects, rewrites, and headers, see [configuration.md](references/configuration.md). ### 2. Deploying For instructions on deploying your site, using preview channels, and managing releases, see [deploying.md](references/deploying.md). ### 3. Emulation To test your app locally: ```bash npx -y firebase-tools@latest emulators:start --only hosting ``` This serves your app at `http://localhost:5000` by default. # Hosting Configuration (`firebase.json`) The `hosting` section of `firebase.json` configures how your site is deployed and served. ## Key Attributes ### `public` (Required) Specifies the directory to deploy to Firebase Hosting. ```json "hosting": { "public": "public" } ``` ### `ignore` (Optional) Files to ignore on deploy. Uses glob patterns (like `.gitignore`). **Default ignores:** `firebase.json`, `**/.*`, `**/node_modules/**` ### `redirects` (Optional) URL redirects to prevent broken links or shorten URLs. ```json "redirects": [ { "source": "/foo", "destination": "/bar", "type": 301 } ] ``` ### `rewrites` (Optional) Serve the same content for multiple URLs, useful for SPAs or Dynamic Content. ```json "rewrites": [ { "source": "**", "destination": "/index.html" }, { "source": "/api/**", "function": "apiFunction" }, { "source": "/container/**", "run": { "serviceId": "helloworld", "region": "us-central1" } } ] ``` ### `headers` (Optional) Custom response headers. ```json "headers": [ { "source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)", "headers": [ { "key": "Access-Control-Allow-Origin", "value": "*" } ] } ] ``` ### `cleanUrls` (Optional) If `true`, drops `.html` extension from URLs. ```json "cleanUrls": true ``` ### `trailingSlash` (Optional) Controls trailing slashes in static content URLs. - `true`: Adds trailing slash. - `false`: Removes trailing slash. ## Full Example ```json { "hosting": { "public": "dist", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ], "cleanUrls": true, "trailingSlash": false } } ``` # Deploying to Firebase Hosting ## Standard Deploy