Repository navigation
build(deploy): Deploy to Cloud Run on every merge to main - #181
Merged
Merged
Conversation
Co-Authored-By: Armen Zambrano Gasparnian <44410+armenzg@users.noreply.github.com>
Co-Authored-By: Armen Zambrano Gasparnian <44410+armenzg@users.noreply.github.com>
armenzg
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now the Cloud Build trigger on
mainonly builds and pushes the image, and someone has to deploy it by hand from the Cloud Run console. This adds the deploy tocloudbuild.yaml, so every merge tomainrolls out a new revision.Changes to
cloudbuild.yaml:docker push --all-tagsstep. Cloud Build pushes theimages:list only after every step finishes, so without this step the deploy would run before the image exists in the registry.images:stays so the build still records the pushed images.gcloud run deploystep that deploys:${COMMIT_SHA}. It deploys by tag rather than digest because of the attestation manifest problem described at the top of the file, and by SHA rather thanlatestso each revision points at a fixed commit. Because it passes only--image, the service keeps its env vars, secrets and runtime service account (github-actions-app@sentry-dev-tooling.iam.gserviceaccount.com)._SERVICE(github-actions-app) and_REGION(us-central1) substitutions. Both match the service's details page in the Cloud Run console. The trigger can override either one.options.logging: CLOUD_LOGGING_ONLY. Cloud Build rejects a build that runs as a user-managed service account unless the config sets a logs bucket or this option. It also works with the legacy Cloud Build service account.docs/deployment.mdnow describes the automatic deploy, how to roll back, and the IAM roles the trigger needs.IAM: the trigger runs as the legacy Cloud Build service account,
709462749167@cloudbuild.gserviceaccount.com. In getsentry/ops (terraform/sentry-dev-tooling/iam/iam.tf), that account already hasroles/cloudbuild.builds.builder,roles/run.adminand a project-levelroles/iam.serviceAccountUser. That covers pushing the image and deploying as the runtime account, so this PR needs no IAM changes. Moving the trigger to a dedicated, narrower service account would be a separate change in getsentry/ops.via @armenzg.
--
View Session [Sentry]