Google Cloud Professional Cloud Architect — Question 218
You are using a GitHub repository for your application’s source code. You want to set up an efficient and secure continuous deployment process to automatically build and deploy the application to Cloud Run whenever a pull request is merged. What should you do?
Answer options
- A. Create a GitHub webhook trigger in Cloud Build. Once a pull request is merged, trigger Cloud Build to build a container image and save it in Artifact Registry. Use Config Sync to deploy the application to Cloud Run.
- B. Create a workflow using GitHub Actions to build and deploy the application to Cloud Run once a pull request is merged. The workflow will use a service account key checked in with your source code for deployment permission.
- C. Create a GitHub Enterprise trigger in Cloud Build. Once a pull request is merged, trigger Cloud Build to build and deploy the application to Cloud Run. Save the deployment credential to Secret Manager.
- D. Connect your repository using the Cloud Build GitHub app. Create a trigger in Cloud Build. Once a pull request is merged, trigger Cloud Build to build and deploy the application to Cloud Run.
Correct answer: D
Explanation
The correct answer is D because it incorporates the Cloud Build GitHub app, which simplifies the integration process for triggers and deployments. Option A incorrectly suggests using a webhook, which is less efficient than the app, while B relies on GitHub Actions and a service account key, which adds unnecessary complexity. Option C mentions GitHub Enterprise, which is not needed for standard deployments.