This Repo Demonstrate the CI/CD pipeline using GitHub Actions, Docker, and ArgoCD β including Dockerfile creation guidance and CLI setup in WSL (Windows Subsystem for Linux).
Before running the pipeline, ensure your project contains:
- A Dockerfile at project root (builds the application container).
- Kubernetes manifests under
manifest/, includingdeployment.yaml. - A
.github/workflows/ci-cd.ymlfile (see stages below). - Required GitHub Secrets for Docker and ArgoCD access.
Triggered on:
pushtomainbranch, excluding changes inmanifest/.- Deploy only when code updates are committed.
Securely provided via GitHub Secrets:
PERSONAL_ACCESS_TOKEN,DOCKERHUB_USERNAME,DOCKERHUB_PASSWORDARGOCD_SERVER,ARGOCD_USERNAME,ARGOCD_PASSWORDGIT_USERNAME,GIT_EMAIL
The GitHub Actions workflow is triggered on pushes to the main branch, excluding changes to the manifest/ directory.
Sensitive credentials are managed securely through GitHub Secrets, including:
- DockerHub credentials
- GitHub PAT for repository access
- ArgoCD server and login credentials
- Git configuration values
Job Name: build
Purpose: Build and publish the Docker image
- Checkout Code: Clone the repository using a personal access token.
- Node Setup & Install: Set up Node.js (v14) and install dependencies via
npm. - Docker Build: Containerize the application using the current commit SHA as the tag.
- Security Scan: Scan the built Docker image using Trivy.
- Docker Login & Push: Authenticate to Docker Hub and push the image.
Job Name: deploy
Runs After: Successful build stage
Purpose: Update Kubernetes manifests and trigger deployment via ArgoCD
- Checkout Code: Pull the latest repo content for deployment changes.
- Install CLI Tools: Install
kubectlandargocdcommand-line tools. - Login to ArgoCD: Authenticate using stored credentials.
- Update Manifest: Modify the image tag in
manifest/deployment.yamlto match the new Docker image. - Commit Changes: Push the updated manifest back to the
mainbranch. - Sync ArgoCD App: Trigger ArgoCD to sync and deploy the updated application.
- Code push to
mainstarts the workflow. - App is built, scanned, and pushed to Docker Hub.
- Deployment manifest is updated with the new image tag.
- ArgoCD is instructed to deploy the new version automatically.
- GitHub Actions β For automation of CI/CD pipeline
- Docker β For containerization and image distribution
- Trivy β For security vulnerability scanning
- ArgoCD β For GitOps-based Kubernetes deployment
- Node.js β As application runtime