A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/build/docs/deploying-builds/deploy-firebase below:

Deploying to Firebase | Cloud Build Documentation

Skip to main content Deploying to Firebase

Stay organized with collections Save and categorize content based on your preferences.

This page explains how to deploy applications to Firebase using Cloud Build. If you're new to Cloud Build, read the quickstarts and the Build configuration overview first.

Before you begin

Caution: Effective June 17, 2024, Cloud Source Repositories isn't available to new customers. If your organization hasn't previously used Cloud Source Repositories, you can't enable the API or use Cloud Source Repositories. New projects not connected to an organization can't enable the Cloud Source Repositories API. Organizations that have used Cloud Source Repositories prior to June 17, 2024 are not affected by this change.

Required IAM permissions
  1. Open the IAM page in the Google Cloud console:

    Open the IAM page

  2. Select your project and click Open.

  3. In the permissions table, locate the email for the service account you are using for the build and click the pencil icon.

  4. Add the Cloud Build Service Account(roles/cloudbuild.builds.builder), Firebase Admin (roles/firebase.admin), andAPI Keys Admin (roles/serviceusage.apiKeysAdmin) roles to the service account.

  5. Click Save.

Using the firebase Docker image

Cloud Build provides a builder image that you can use to invoke firebase commands in Cloud Build. To use this builder in a Cloud Build config file, you can use the firebase build step to deploy to Firebase:

  1. Create a build config file named cloudbuild.yaml or cloudbuild.json where PROJECT_ID is your Google Cloud project ID and FIREBASE_PROJECT_ID is your Firebase project ID:

    YAML
    steps:
    - name: "us-docker.pkg.dev/firebase-cli/us/firebase"
       args: ['deploy', '--project=FIREBASE_PROJECT_ID', '--only=hosting']
    ## Or, target a specific version of firebase-tools
    - name: "us-docker.pkg.dev/firebase-cli/us/firebase":x.y.z
       args: ['deploy', '--project=FIREBASE_PROJECT_ID', '--only=hosting']
    
    JSON
    {
      "steps": [
       {
          "name": "us-docker.pkg.dev/firebase-cli/us/firebase",
          "args": [
             "deploy",
             "--project",
             "FIREBASE_PROJECT_ID",
             "--only",
             "hosting"
           ]
      }
      ]
    }
    

    You can choose a specific version of firebase-tools by using
    name: "us-docker.pkg.dev/firebase-cli/us/firebase":x.y.z

  2. Start the build using the build config file:

    gcloud builds submit --region=REGION --config CONFIG_FILE_PATH SOURCE_DIRECTORY
    

    Where:

Continuous deployment

You can automate the deployment of your software to Firebase by creating Cloud Build triggers. You can configure triggers to build and deploy images whenever you update your source code.

To automate your deployment to Firebase:

  1. In your repository, add a build config file with steps to invoke the firebase deploy command where PROJECT_ID is your Google Cloud project ID:

    YAML
    steps:
          - name: us-docker.pkg.dev/firebase-cli/us/firebase
            args: ['deploy', '--project=PROJECT_ID', '--only=hosting']
    
    JSON
    {
      "steps": [
       {
          "name": "us-docker.pkg.dev/firebase-cli/us/firebase",
          "args": [
             "deploy",
             "--project",
             "PROJECT_ID",
             "--only",
             "hosting"
           ]
      }
      ]
    }
    
  2. Create a trigger with the build config file created in the previous step:

    1. Open the Triggers page in the Google Cloud console:

      Open Triggers page

    2. Select your project from the project selector drop-down menu at the top of the page.

    3. Click Open.

    4. Click Create trigger.

      On the Create trigger page, enter the following settings:

      1. Enter a name for your trigger.

      2. Select the repository event to start your trigger.

      3. Select the repository that contains your source code and build config file.

      4. Specify the regex for the branch or tag name that will start your trigger.

      5. Configuration: Choose the build config file you created previously.

    5. Click Create to save your build trigger.

Anytime you push new code to your repository, you will automatically start a build and deploy on Firebase.

For more information on creating Cloud Build triggers, see Creating and managing build triggers.

Code example

To view a code sample for deploying to Firebase using Cloud Build, go to deploy-firebase-example.

What's next

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 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This page provides instructions on deploying applications to Firebase using Cloud Build, assuming familiarity with Cloud Build's quickstarts and build configuration."],["Before deploying, you must enable the Cloud Build, Firebase, and Resource Manager APIs, and have your application source code, including `firebase.json`, stored in a repository."],["To deploy, you need to use the Firebase community builder image, which involves building and pushing it to the Container Registry or Artifact Registry."],["Deployment is configured via a build config file (`cloudbuild.yaml` or `cloudbuild.json`) specifying the Firebase project and deployment details."],["You can set up continuous deployment to Firebase by creating Cloud Build triggers that automatically deploy updates whenever changes are pushed to the connected repository."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4