Skip to main content

CI/CD Pipeline

This document provides an overview of the Continuous Integration and Continuous Deployment (CI/CD) pipeline powered by GitHub Actions.

The pipeline automates the software delivery process by building container images, deploying applications, and managing Kubernetes resources across multiple environments.

:::tip What this pipeline does

  • πŸš€ Build and publish Docker images
  • ☸️ Deploy applications to Kubernetes
  • βš™οΈ Manage environment configuration with ConfigMaps
  • πŸ”„ Apply Kubernetes resources automatically
  • πŸ”’ Ensure consistent and reliable deployments

:::


Pipeline Overview

The deployment process is composed of four reusable GitHub Actions workflows.

flowchart LR

A[Developer Pushes Code] --> B[Build Image]
B --> C[Deploy to Environment]
C --> D[Update ConfigMap]
D --> E[Deploy Kubernetes Resources]
E --> F[Application Running]
WorkflowDescription
build_image.ymlBuilds and pushes the Docker image
deploy_to_environment.ymlDeploys the application to the target environment
update_configmap.ymlUpdates Kubernetes ConfigMaps
deploy_kubernetes_resources.ymlApplies Kubernetes manifests and Helm resources

Workflow Details

1. Build Image​

Workflow: build_image.yml

Purpose​

Builds the Docker image and pushes it to the configured container registry.

Trigger​

  • Called by another workflow (workflow_call)
  • Can also be executed manually

Workflow​

flowchart TD

A[Checkout Source Code]
--> B[Login to Container Registry]
--> C[Build Docker Image]
--> D[Tag Image]
--> E[Push Image]

Steps​

  1. Checkout the latest source code.
  2. Authenticate to the container registry.
  3. Build the Docker image.
  4. Tag the image.
  5. Push the image to the registry.

Environment Variables​

VariableDescription
REGISTRYContainer registry (GHCR, Docker Hub, etc.)
REPO_NAMEImage repository
PROJECTProject identifier
ENV_APPEnvironment-specific application name

2. Deploy to Environment​

Workflow: deploy_to_environment.yml

Purpose​

Deploys the latest application image into the selected environment.

Trigger​

  • Push to deployment branches
  • Depends on build_image.yml

Workflow​

flowchart TD

A[Build Image]
--> B[Authenticate to Kubernetes]
--> C[Update Deployment]
--> D[Deploy Application]

Steps​

  1. Build the latest Docker image.
  2. Authenticate with the Kubernetes cluster.
  3. Update deployment manifests.
  4. Deploy the application.

3. Update ConfigMap​

Workflow: update_configmap.yml

Purpose​

Updates Kubernetes ConfigMaps that store environment-specific configuration.

Trigger​

Runs whenever configuration files are modified.

Workflow​

flowchart TD

A[Read Existing ConfigMap]
--> B[Update Values]
--> C[Apply ConfigMap]

Steps​

  1. Retrieve the current ConfigMap.
  2. Update configuration values.
  3. Apply the changes to Kubernetes.

Why use ConfigMaps?​

:::info Benefits

  • No need to rebuild container images for configuration changes.
  • Keeps configuration separate from application code.
  • Simplifies environment management.
  • Improves maintainability.

:::


4. Deploy Kubernetes Resources​

Workflow: deploy_kubernetes_resources.yml

Purpose​

Deploys Kubernetes manifests and Helm resources.

Trigger​

  • After deployment workflow completes
  • Can also be run manually

Workflow​

flowchart TD

A[Authenticate Cluster]
--> B[Apply ConfigMaps]
--> C[Deploy Application]
--> D[Verify Deployment]

Steps​

  1. Authenticate with the Kubernetes cluster.
  2. Apply ConfigMaps and Secrets.
  3. Deploy the latest application version.
  4. Verify deployment health.

Deployment Flow

flowchart LR

Developer --> GitHub

GitHub --> BuildImage
BuildImage --> ContainerRegistry

ContainerRegistry --> Deploy

Deploy --> Kubernetes

Kubernetes --> ConfigMap
ConfigMap --> Deployment

Deployment --> RunningApplication

Technologies

ToolPurpose
GitHub ActionsCI/CD Automation
DockerContainerization
GitHub Container Registry (GHCR)Image Registry
KubernetesContainer Orchestration
HelmKubernetes Package Manager
kubectlKubernetes CLI

Deployment Environments

EnvironmentPurpose
DevelopmentActive feature development
StagingPre-production validation
ProductionLive production environment

Summary

The CI/CD pipeline provides a standardized deployment process that ensures applications are consistently built, tested, and deployed across all environments.

Its modular GitHub Actions workflows simplify maintenance while enabling automated, secure, and reliable Kubernetes deployments.