Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
[[["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-27 UTC."],[],[],null,["# Step 2: Create a Cloud Run service\n\nIn this step, you create a Cloud Run service to deploy the app from the\nrepository that you forked in the previous step. You also set up an automatic\nCloud Build trigger, so that the app is built and deployed to Google Cloud\nwhenever you push a new commit to the repository.\n\nCreate a Cloud Run service with continuous build\n------------------------------------------------\n\n1. In the Google Cloud console, navigate to Cloud Run.\n\n [Go to Cloud Run](https://console.cloud.google.com/run)\n2. Click **Create service**.\n\n3. Select **Continuously deploy from a repository**.\n\n4. Click **Set up with Cloud Build**.\n\n5. In the **Repository** list, select the forked GitHub repository that you created\n for your app.\n\n If your repository isn't listed, click **Manage connected repositories**.\n While completing this step, do the following, if prompted:\n - Authenticate to GitHub.\n\n - Install Cloud Build on your GitHub account.\n\n6. If you're selecting a repository for the first time for use with\n Cloud Build in your project, select the checkbox to agree to the terms of\n use policy.\n\n7. Click **Next**.\n\n8. In the **Build configuration** section, enter the following details:\n\n - **Branch** : The default branch is `^main$`. Don't update this.\n\n - **Build type** : Click **Dockerfile**.\n\n - **Source location**: Enter the following:\n\n /gemini/sample-apps/gemini-streamlit-cloudrun/Dockerfile\n\n9. Click **Save**.\n\n10. On the **Create service** page, enter the following details in the **Configure** section:\n\n - **Service name** : Enter `gemini-streamlit-cloudrun`.\n\n - **Authentication** : Click **Allow unauthenticated invocations**.\n\n - **Service autoscaling** : Set the **Minimum number of instances** to `1`.\n\n11. Click **Container(s), volumes, networking, security**.\n\n12. In the **Revision autoscaling** section, enter the following:\n\n - **Minimum number of instances** : Enter `1`.\n\n - **Maximum number of instances** : Enter `3`.\n\n13. Click **Create**.\n\n14. Optional: To test the app deployment to Cloud Run, do the following: \n\n 1. On the **Services** page in Cloud Run, click the service name.\n\n [Go to the Services page](https://console.cloud.google.com/run)\n 2. On the **Service details** page, click the **URL** displayed next to the service name.\n\nSet up an automatic Cloud Build trigger\n---------------------------------------\n\n1. Navigate to the **Triggers** page in Cloud Build.\n\n [Go to the Triggers page](https://console.cloud.google.com/cloud-build/triggers)\n2. Click the name of your new trigger.\n\n3. Under **Source** , click to expand **Show included and ignored files filters**.\n\n4. In the **Included files filter** box, enter `gemini-streamlit-cloudrun/**`.\n\n5. Click **Save**.\n\n | **Tip:** If you want to manually build the Cloud Run service again, go to the **Triggers** page and click **Run**."]]