This change introduces a GitHub Action workflow that enables continuous deployment of a Node.js app to GKE using Terraform and Helm. The workflow is triggered by pushes to the main branch and performs the following steps:
Checkout the code from the repository
Setup the gcloud CLI and authenticate using a service account key stored as a GitHub secret
Setup Terraform and apply the the main.tfonfiguration located in terraform/dev. This provisions the necessary resources for the application deployment pipeline, such as a GKE cluster, an Artifact Registry repo and a GCS bucket for TF state management.
Authenticate Docker to use the gcloud CLI as a credential helper
Get the credentials for the GKE cluster.
Build a Docker image for the application and tag it with the commit SHA.
Push the Docker image to the GCP Artifact Registry.
Setup Helm and package the Helm chart located in k8s/ using the commit SHA as the chart version.
Publish the chart to GCP Artifact Registry(Used as chart repo as well).
Deploy the chart to the GKE cluster using Helm, specifying the image tag and namespace.
This workflow allows for automated and reliable deployment of the infrastructure and application on GKE, and can be easily adapted for use in other environments/clouds.
This change introduces a GitHub Action workflow that enables continuous deployment of a Node.js app to GKE using Terraform and Helm. The workflow is triggered by pushes to the main branch and performs the following steps:
main.tf
onfiguration located interraform/dev
. This provisions the necessary resources for the application deployment pipeline, such as a GKE cluster, an Artifact Registry repo and a GCS bucket for TF state management.k8s/
using the commit SHA as the chart version.This workflow allows for automated and reliable deployment of the infrastructure and application on GKE, and can be easily adapted for use in other environments/clouds.