Skip to content

# Flow diagram for CI pipeline steps in google.yml #267

@Dargon789

Description

@Dargon789

Reviewer's Guide

Adds a GitHub Actions workflow to build a Docker image, push it to Google Artifact Registry, and deploy it to a GKE cluster on pushes to the main/master branches using Workload Identity Federation for authentication.

Flow diagram for CI pipeline steps in google.yml

flowchart TD
  A["Push to main or master branch"] --> B["Trigger Build and Deploy to GKE workflow"]
  B --> C["Start job setup-build-publish-deploy on ubuntu-latest"]
  C --> D["Checkout repository (actions/checkout)"]
  D --> E["Authenticate to Google Cloud (google-github-actions/auth) using Workload Identity Provider"]
  E --> F["Docker login to Artifact Registry (docker/login-action) with auth token"]
  F --> G["Get GKE credentials (google-github-actions/get-gke-credentials)"]
  G --> H["Build Docker image with build args and tag using GITHUB_SHA"]
  H --> I["Push Docker image to Artifact Registry"]
  I --> J["Download and make kustomize executable"]
  J --> K["Update kustomize image to new Artifact Registry image tag"]
  K --> L["kustomize build and kubectl apply to GKE cluster"]
  L --> M["kubectl rollout status for deployment"]
  M --> N["kubectl get services -o wide"]
Loading

File-Level Changes

Change Details Files
Introduce a GKE deployment GitHub Actions workflow using Google Cloud auth and Artifact Registry.
  • Add a workflow triggered on pushes to designated branches to build, push, and deploy a Docker image to GKE
  • Configure environment variables for GCP project, Artifact Registry location, GKE cluster/zone, deployment name, repository, image name, and workload identity provider
  • Authenticate to Google Cloud via google-github-actions/auth using Workload Identity Federation and obtain an access token for Docker
  • Log in to Artifact Registry with docker/login-action using the federated access token
  • Fetch GKE cluster credentials with google-github-actions/get-gke-credentials to allow kubectl operations
  • Build and push a Docker image tagged with the current commit SHA to Artifact Registry
  • Download and configure kustomize for Kubernetes manifests manipulation and deployment
  • Update the image reference in kustomize configuration, apply manifests to the cluster, wait for rollout, and list services
.github/workflows/google.yml

Possibly linked issues

  • Create google.yml #87: The PR adds .github/workflows/google.yml, exactly implementing the GKE CI/CD workflow requested in the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Originally posted by @sourcery-ai[bot] in #266 (comment)

Metadata

Metadata

Assignees

Labels

Projects

Status

In Review

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions