Google Cloud Professional Cloud Developer — Question 136

You are developing a new web application using Cloud Run and committing code to Cloud Source Repositories. You want to deploy new code in the most efficient way possible. You have already created a Cloud Build YAML file that builds a container and runs the following command: gcloud run deploy. What should you do next?

Answer options

Correct answer: B

Explanation

The correct answer is B because a build trigger automatically starts the build process when code is pushed to the specified branch, making deployments efficient and seamless. Option A involves additional steps with Pub/Sub that aren't necessary for direct code pushes, while option C requires external HTTP requests which complicate the process. Option D is not efficient for immediate deployment as it relies on a time schedule rather than code changes.