This project demonstrates the deployment of a React application using a CI/CD pipeline and Kubernetes. The application is containerized with Docker, stored in Google Artifact Registry, and deployed to a Google Kubernetes Engine (GKE) cluster. The pipeline is automated using GitHub Actions
- Automated CI/CD pipeline using GitHub Actions.
- Containerized application using Docker.
- Deployment and management of application using Kubernetes (GKE).
- Frontend: React (Node.js)
- CI/CD: GitHub Actions
- Containerization: Docker
- Artifact Storage: Google Artifact Registry
- Orchestration: Kubernetes (Google Kubernetes Engine)
- Cloud Platform: Google Cloud Platform (GCP)
- Configuration Management: YAML
Before you begin, ensure you have the following installed:
- Node.js (v14 or later)
- npm (v6 or later)
- Docker/ Docker Desktop
- kubectl
- Google Cloud SDK
- Git
- Clone the repository
git clone- Install dependencies
npm install- Run the application
npm start- Build the application
npm run build- Create a Docker image
docker build -t <image-name> .- Run the Docker container
docker run -p 8080:8080 <image-name>To run tests, use the following command:
npm test./scripts/smoke-test.shThe CI/CD pipeline is automated using GitHub Actions. The pipeline consists of the following stages:
- Build: Install dependencies and build the application.
- Test: Run unit tests.
- Build Docker image: Create a Docker image of the application.
- Push Docker image: Push the Docker image to Google Artifact Registry.
- Deploy to GKE: Deploy the application to a GKE cluster.
- Smoke test: Run smoke tests on the deployed application.
To deploy to a Kubernetes cluster, read the deployment guide from Google Cloud Platform here.