Skip to content

StenOskar/portfolio_project

Repository files navigation

React App Deployment with CI/CD and Kubernetes

Overview

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

Features

  • Automated CI/CD pipeline using GitHub Actions.
  • Containerized application using Docker.
  • Deployment and management of application using Kubernetes (GKE).

Technologies Used

  • 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

Prerequisites

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

Installation

  1. Clone the repository
git clone
  1. Install dependencies
npm install
  1. Run the application
npm start
  1. Build the application
npm run build

Running the application in a Docker container

  1. Create a Docker image
docker build -t <image-name> .
  1. Run the Docker container
docker run -p 8080:8080 <image-name>

Testing

To run tests, use the following command:

npm test

Running smoke tests

./scripts/smoke-test.sh

CI/CD Pipeline

The 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.

Deployment to kubernetes

To deploy to a Kubernetes cluster, read the deployment guide from Google Cloud Platform here.

About

This is the portfolio project for IDATA2502

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published