Quickstart: Deploy to Cloud Run from a git repository

This page shows you how to continuously deploy from a git repository to Cloud Run.


To follow step-by-step guidance for this task directly in the Google Cloud console, click Guide me:

Guide me


Full instructions for this process can be found at Continuous deployment from Git using Cloud Build.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  5. Make sure that billing is enabled for your Google Cloud project.

  6. Enable the Cloud Build API.

    Enable the API

  7. If you are under a domain restriction organization policy restricting unauthenticated invocations for your project, you will need to access your deployed service as described under Testing private services.

Create a repository from template

To create a repository:

  1. Go to the template repository:

  2. Click Use this template.

  3. Select Create a new repository.

  4. In the form, enter a repository name.

  5. Click Create repository from template.

Deploy from the repository

To deploy from the repository:

  1. In the Google Cloud console, go to the Cloud Run page:

    Go to Cloud Run

  2. Click Deploy container and select Service.

  3. In the Create service, ensure the Continuously deploy from a repository option is selected.

  4. In the form, click Set up Cloud Build.

  5. In the right panel:

    1. Under Repository, select the newly created repository. If you haven't already authenticated, you might be required to do so. Use the authenticate link under the Repository Provider field.

    2. Check the confirmation agreement about GitHub and Google Cloud interactivity.

    3. Click Next.

    4. Under Build Type, select Google Cloud Buildpacks.

    5. Click Save.

  6. In the Create service form:

    1. Confirm the name of the service. It will be automatically populated with the repository name.

    2. In the Region pulldown menu, select the region where you want your service located.

    3. Under Authentication, select Allow unauthenticated invocations. If you don't have permissions (Cloud Run Admin role) to select this, the service will deploy and require authentication.

    4. Click Create to deploy the sample repository to Cloud Run and wait for the deployment to finish.

  7. Click the displayed URL link to run the deployed container.

Cloud Run locations

Cloud Run is regional, which means the infrastructure that runs your Cloud Run services is located in a specific region and is managed by Google to be redundantly available across all the zones within that region.

Meeting your latency, availability, or durability requirements are primary factors for selecting the region where your Cloud Run services are run. You can generally select the region nearest to your users but you should consider the location of the other Google Cloud products that are used by your Cloud Run service. Using Google Cloud products together across multiple locations can affect your service's latency as well as cost.

Cloud Run is available in the following regions:

Subject to Tier 1 pricing

  • asia-east1 (Taiwan)
  • asia-northeast1 (Tokyo)
  • asia-northeast2 (Osaka)
  • europe-north1 (Finland) leaf icon Low CO2
  • europe-southwest1 (Madrid) leaf icon Low CO2
  • europe-west1 (Belgium) leaf icon Low CO2
  • europe-west4 (Netherlands) leaf icon Low CO2
  • europe-west8 (Milan)
  • europe-west9 (Paris) leaf icon Low CO2
  • me-west1 (Tel Aviv)
  • us-central1 (Iowa) leaf icon Low CO2
  • us-east1 (South Carolina)
  • us-east4 (Northern Virginia)
  • us-east5 (Columbus)
  • us-south1 (Dallas) leaf icon Low CO2
  • us-west1 (Oregon) leaf icon Low CO2

Subject to Tier 2 pricing

  • africa-south1 (Johannesburg)
  • asia-east2 (Hong Kong)
  • asia-northeast3 (Seoul, South Korea)
  • asia-southeast1 (Singapore)
  • asia-southeast2 (Jakarta)
  • asia-south1 (Mumbai, India)
  • asia-south2 (Delhi, India)
  • australia-southeast1 (Sydney)
  • australia-southeast2 (Melbourne)
  • europe-central2 (Warsaw, Poland)
  • europe-west10 (Berlin) leaf icon Low CO2
  • europe-west12 (Turin)
  • europe-west2 (London, UK) leaf icon Low CO2
  • europe-west3 (Frankfurt, Germany) leaf icon Low CO2
  • europe-west6 (Zurich, Switzerland) leaf icon Low CO2
  • me-central1 (Doha)
  • me-central2 (Dammam)
  • northamerica-northeast1 (Montreal) leaf icon Low CO2
  • northamerica-northeast2 (Toronto) leaf icon Low CO2
  • southamerica-east1 (Sao Paulo, Brazil) leaf icon Low CO2
  • southamerica-west1 (Santiago, Chile) leaf icon Low CO2
  • us-west2 (Los Angeles)
  • us-west3 (Salt Lake City)
  • us-west4 (Las Vegas)

If you already created a Cloud Run service, you can view the region in the Cloud Run dashboard in the Google Cloud console.

Update the service

To make changes to the service:

  1. Push a commit to the main branch of the repository.

  2. Refresh the Cloud Run service to see the status of the update.

Congratulations! You have just deployed to Cloud Run from a git repository. Cloud Run automatically scales your container out to handle the received requests, then scales in when demand decreases. You only pay for the CPU, Memory and Networking consumed during request handling.

What's next