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]
| Workflow | Description |
|---|---|
build_image.yml | Builds and pushes the Docker image |
deploy_to_environment.yml | Deploys the application to the target environment |
update_configmap.yml | Updates Kubernetes ConfigMaps |
deploy_kubernetes_resources.yml | Applies 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β
- Checkout the latest source code.
- Authenticate to the container registry.
- Build the Docker image.
- Tag the image.
- Push the image to the registry.
Environment Variablesβ
| Variable | Description |
|---|---|
REGISTRY | Container registry (GHCR, Docker Hub, etc.) |
REPO_NAME | Image repository |
PROJECT | Project identifier |
ENV_APP | Environment-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β
- Build the latest Docker image.
- Authenticate with the Kubernetes cluster.
- Update deployment manifests.
- 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β
- Retrieve the current ConfigMap.
- Update configuration values.
- 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β
- Authenticate with the Kubernetes cluster.
- Apply ConfigMaps and Secrets.
- Deploy the latest application version.
- Verify deployment health.
Deployment Flow
flowchart LR
Developer --> GitHub
GitHub --> BuildImage
BuildImage --> ContainerRegistry
ContainerRegistry --> Deploy
Deploy --> Kubernetes
Kubernetes --> ConfigMap
ConfigMap --> Deployment
Deployment --> RunningApplication
Technologies
| Tool | Purpose |
|---|---|
| GitHub Actions | CI/CD Automation |
| Docker | Containerization |
| GitHub Container Registry (GHCR) | Image Registry |
| Kubernetes | Container Orchestration |
| Helm | Kubernetes Package Manager |
| kubectl | Kubernetes CLI |
Deployment Environments
| Environment | Purpose |
|---|---|
| Development | Active feature development |
| Staging | Pre-production validation |
| Production | Live 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.