透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Firebase App Hosting
plat_web
Firebase App Hosting 可簡化動態網頁應用程式的開發和部署作業,提供 GitHub 整合功能,並與其他 Firebase 產品 (例如 Authentication、Cloud Firestore 和 Firebase AI Logic) 整合。App Hosting 內建預先設定的 Next.js 和 Angular 支援功能,並提供對各種熱門網頁架構的更廣泛支援。
開始使用
主要功能
GitHub 整合 |
只要使用 Git 修訂版本,即可推出應用程式的新版本。
App Hosting 可在您推送至特定分支時自動部署。
|
Google Cloud 提供支援 |
App Hosting 會使用 Google Cloud 服務條款,並將您的應用程式部署至您信任的 Google Cloud 產品。應用程式是使用 Cloud Build 建構,並在 Cloud Run 上提供服務,並在 Cloud CDN 中快取。如 Cloud Secret Manager 等整合服務可確保 API 金鑰安全。 |
大規模推出 AI 輔助功能 |
請先試試使用 Gemini 的 AI 範例。
使用 Cloud Secret Manager 保護 API 端點的 API 金鑰,並善用應用程式代管服務的串流支援功能,在將生成式 AI 功能加入應用程式時,維持快速的初始載入時間。 |
Firebase 主控台整合 |
在 Firebase 控制台中監控版本和推出作業,隨時掌握最新動態。存取記錄和指標、新增自訂網域,以及透過 Firebase 控制台手動觸發推出作業。 |
運作原理
- 使用 Firebase 控制台或 Firebase CLI,在存放區中授權並安裝 Firebase GitHub 應用程式。
- 請在 Firebase 主控台或 Firebase CLI 中建立 Firebase App Hosting 後端,並使用存放區和實際分支來進行持續部署。App Hosting 會為後端建立預設的發布政策,以便在變更推送至目標分支時,立即發布至 100% 的流量。
- 當提交內容推送至實際分支時,Google Cloud Developer Connect 會將事件傳送至 Firebase App Hosting。
- 針對此事件做出回應時,Firebase App Hosting 會為連結至存放區的後端建立新建構。
- 首先,Firebase App Hosting 會為您的版本建立新的 Cloud Build 版本。在這個工作中,Google Cloud Buildpacks 會判斷應用程式使用哪個架構,以便建立適合應用程式的容器和設定 (包括環境變數、機密、最小或最大執行個體、並行記憶體、CPU 和 VPC 設定)。詳情請參閱 App Hosting 建構程序。
- Cloud Build 工作完成後,容器會儲存在專屬於 Firebase App Hosting 的 Artifact Registry 存放區中。Firebase App Hosting 接著會使用您的映像檔和設定,將新的 Cloud Run 修訂版本新增至 Cloud Run 服務。
- Cloud Run 修訂版本完成並經過驗證後,Firebase App Hosting 會修改流量設定,將所有新要求指向新的 Cloud Run 修訂版本。此時,這項功能已全面推出。
- 當要求傳送至 Firebase App Hosting 上託管的網站時,Google Cloud Load Balancer 會啟用 Cloud CDN 並提供要求。未快取的要求會傳送至 Cloud Run 服務。
實作路徑
|
設定 Firebase |
如果您還沒有 Firebase 專案,請建立專案,並確認已啟用 Blaze 定價方案。 |
|
設定「App Hosting」 |
使用 Firebase 控制台或 Firebase CLI 建立 App Hosting 後端。這是應用程式的受管理資源集合,包括應用程式與 GitHub 存放區的連線。 |
|
管理及監控應用程式 |
建立 App Hosting 後端後,應用程式就會在其免費子網域上提供,您也可以在 Firebase 控制台中查看推出作業的詳細資料。您可以使用 Google Cloud 主控台查看及搜尋記錄。 |
|
開發應用程式 |
App Hosting 會在每次將修訂版本推送至使用中的分支版本時,自動啟動新的推出作業。 |
後續步驟
- 開始部署應用程式。
- 試試 App Hosting 程式碼研究室,將代管應用程式與 Firebase 驗證和 Google AI 功能整合:Next.js | Angular。}
- 進一步瞭解 App Hosting 支援的各種社群支援架構。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[null,null,["上次更新時間:2025-08-08 (世界標準時間)。"],[],[],null,["Firebase App Hosting \nplat_web \n\nFirebase App Hosting streamlines the development and deployment of dynamic\nweb apps, offering GitHub integration and integration with other Firebase\nproducts like Authentication, Cloud Firestore, and Firebase AI Logic.\nApp Hosting has built-in, preconfigured support for Next.js and Angular\nas well as broader support for various popular web frameworks.\n\n[Get started](/docs/app-hosting/get-started)\n\nKey capabilities\n\n|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| GitHub integration | A git commit is all that's needed to roll out a new version of your app. App Hosting can automatically deploy every time you push to a specific branch. |\n| Backed by Google Cloud | App Hosting uses Google Cloud Terms of Service, and deploys your app to Google Cloud products you trust. Apps are built with Cloud Build, served on Cloud Run, and cached in Cloud CDN. Integrated services like Cloud Secret Manager keep your API keys safe. |\n| Ship AI-powered features at scale | Start with AI samples that use Gemini. Protect your API endpoint's API key with Cloud Secret Manager and leverage App Hosting's streaming support to maintain fast initial load times as you add generative AI features into your app. |\n| Firebase console integration | Monitor your builds and rollouts in the Firebase console so you always know what's going on. Access logs and metrics, add a custom domain, and manually trigger rollouts from the Firebase console. |\n\nHow does it work?\n\n1. Using the Firebase console or Firebase CLI, authorize and install the Firebase GitHub app on your repository.\n2. Still in the Firebase console or Firebase CLI, create a Firebase App Hosting backend, with a repository and live branch for continuous deployment. App Hosting creates a default rollout policy for your backend to roll out to 100% of traffic immediately when a change is pushed to the target branch.\n3. When a commit is pushed to your live branch, Google Cloud Developer Connect sends an event to Firebase App Hosting.\n4. Responding to this event, Firebase App Hosting creates a new build for the backend connected to the repository.\n 1. First, Firebase App Hosting creates a new Cloud Build build for your commit. In this job, [Google Cloud buildpacks](https://cloud.google.com/docs/buildpacks/overview) determine which framework is being used in your application to create a container and configuration (including environment variables, secrets, minimum or maximum instances, concurrency memory, CPU, and VPC configuration) that suits your application. See [the App Hosting build process](/docs/app-hosting/build) For more information.\n 2. When the Cloud Build job is complete, your container is stored in an Artifact Registry repository dedicated to Firebase App Hosting. Firebase App Hosting then adds a new Cloud Run Revision to a Cloud Run service using your image and configuration.\n5. Once your Cloud Run Revision is complete and verified healthy, Firebase App Hosting modifies its traffic configuration to point all new requests to your new Cloud Run Revision. At this point, the rollout is complete.\n6. When a request is sent to a website hosted on Firebase App Hosting, the request is served by Google Cloud Load Balancer with Cloud CDN enabled. Uncached requests are sent to your Cloud Run service.\n\nImplementation path\n\n|---|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Set up Firebase | If you don't already have one, create a Firebase project and make sure it has the Blaze pricing plan enabled. |\n| | Set up App Hosting | With the Firebase console or the Firebase CLI, create an App Hosting backend. This is the collection of managed resources for your app, including the connection to the GitHub repository for your app. |\n| | Manage and monitor your app | When you finish creating an App Hosting backend, your app is available on its free subdomain, and you can view details about the rollout in the Firebase console. You can use the [Google Cloud console](https://console.cloud.google.com/logs/query?project=_) to view and search through your logs. |\n| | Develop your app | App Hosting automatically starts a new rollout every time a commit is pushed to your live branch. |\n\nNext steps\n\n- [Get started](/docs/app-hosting/get-started) deploying apps.\n- Try an App Hosting codelab that integrates a hosted app with Firebase Authentication and Google AI features: [Next.js](https://firebase.google.com/codelabs/firebase-nextjs) \\| [Angular](https://firebase.google.com/codelabs/firebase-web).}\n- Learn more about the various [community-supported frameworks](https://firebaseopensource.com/platform/app_hosting) supported by App Hosting."]]