[ Web Proxy ]
URL:
Viewing: https://firebase.google.com/docs/hosting/github-integration [Back]  [Original]

Deploy to live & preview channels via GitHub pull requests  |  Firebase Hosting Skip to main content
Overview Fundamentals AI Build Run Reference Samples
Firebase [Firebase]
Send feedback

Deploy to live & preview channels via GitHub pull requests Stay organized with collections Save and categorize content based on your preferences.

You can integrate deploys to Firebase Hosting via a GitHub Action. Here's what this GitHub Action can do for you:

Reminder: When using preview URLs, your app interacts with the real backend resources of your Firebase project.

Set up the GitHub Action to deploy to Firebase Hosting

  1. Create a GitHub repository (public or private) or use an existing one. You must have admin permissions for the repository.

  2. In a local version of your repo, set up Firebase Hosting using the firebase init command.

    • If you've NOT set up Hosting, run this version of the command from the root of your local directory:

      firebase init hosting
    • If you've ALREADY set up Hosting, then you just need to set up the GitHub Action part of Hosting. Run this version of the command from the root of your local directory:

      firebase init hosting:github
  3. Follow the CLI prompts, and the command will automatically take care of setting up the GitHub Action:

    • Creates a service account in your Firebase project with permission to deploy to Firebase Hosting.

    • Encrypts that service account's JSON key and uploads it to the specified GitHub repository as a GitHub secret.

    • Writes GitHub workflow yaml configuration files that reference the newly created secret. These files configure the GitHub Action to deploy to Firebase Hosting.

  4. In GitHub, create a new branch and commit the workflow yaml files created by the CLI.

  5. Publish the branch to your GitHub repository.

  6. Merge the branch.

That's it! Any subsequent PR in this GitHub repo will automatically get its own "preview URL"!

Learn more about the GitHub Action

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-24 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-24 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page