Setting the file. One moment.
Chapter 09 · Firebase Hosting Basics
Subchapter 9.2
references/deploying.mdMarkdown1 KBView on GitHub
To deploy your Hosting content and configuration to your live site:
npx -y firebase-tools@latest deploy --only hostingThis deploys to your default sites (PROJECT_ID.web.app and
PROJECT_ID.firebaseapp.com).
Preview channels allow you to test changes on a temporary URL before going live.
npx -y firebase-tools@latest hosting:channel:deploy CHANNEL_IDReplace CHANNEL_ID with a name (e.g., feature-beta). This returns a preview
URL like PROJECT_ID--CHANNEL_ID-RANDOM_HASH.web.app.
Channels expire after 7 days by default. To set a different expiration:
npx -y firebase-tools@latest hosting:channel:deploy CHANNEL_ID --expires 1dYou can promote a version from a preview channel to your live channel without rebuilding.
npx -y firebase-tools@latest hosting:clone SOURCE_SITE_ID:SOURCE_CHANNEL_ID TARGET_SITE_ID:liveExample: Clone the feature-beta channel on your default site to live:
npx -y firebase-tools@latest hosting:clone my-project:feature-beta my-project:live