Skip to content

Rashmik3/githubActionAutomation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevOps CI/CD Pipeline Demo

CI/CD Pipeline Docker Pulls Java Spring Boot Docker

A production-grade CI/CD pipeline demonstration built with Spring Boot, GitHub Actions, and Docker. This project showcases a complete automated delivery pipeline from code commit to deployment — the kind of pipeline I design and implement for clients.


Pipeline Architecture

Developer Push
      │
      ▼
┌─────────────────────────────────────────────────────┐
│                  GitHub Actions                      │
│                                                     │
│  ┌──────────┐    ┌─────────────┐    ┌────────────┐  │
│  │  JUnit   │───▶│  Build JAR  │───▶│   Docker   │  │
│  │  Tests   │    │  (Maven)    │    │ Build+Push │  │
│  └──────────┘    └─────────────┘    └─────┬──────┘  │
│                                           │         │
│                          ┌────────────────┴──────┐  │
│                          ▼                       ▼  │
│                   ┌─────────────┐    ┌──────────────┐│
│                   │   Staging   │    │  Production  ││
│                   │  (develop)  │    │    (main)    ││
│                   └─────────────┘    └──────────────┘│
└─────────────────────────────────────────────────────┘

Pipeline Stages

Stage Trigger What it Does
Test Every push & PR Compiles, runs JUnit tests, generates reports
Code Quality After tests pass OWASP dependency vulnerability scan
Build & Push Push to main/develop Builds JAR, creates multi-arch Docker image, pushes to Docker Hub
Deploy Staging Push to develop SSH deploy to staging server, health check
Deploy Production Push to main Zero-downtime deploy, health check, GitHub Release created

Tech Stack

  • Application: Java 17 + Spring Boot 3.2 + Maven
  • CI/CD: GitHub Actions
  • Containerisation: Docker (multi-stage build, multi-arch)
  • Security: OWASP Dependency Check
  • Deployment: SSH-based rolling deploy with health checks

Project Structure

githubActionAutomation/
├── .github/
│   └── workflows/
│       └── ci-cd.yml          # Full pipeline definition
├── src/
│   ├── main/java/com/devops/demo/
│   │   ├── DemoApplication.java
│   │   ├── controller/
│   │   │   └── HealthController.java
│   │   └── service/
│   │       └── HealthService.java
│   ├── main/resources/
│   │   └── application.properties
│   └── test/java/com/devops/demo/
│       └── DemoApplicationTests.java
├── Dockerfile                 # Multi-stage optimised image
├── docker-compose.yml         # Local dev environment
├── pom.xml
└── README.md

Running Locally

Option 1 — Maven

git clone https://github.com/Rashmik3/githubActionAutomation.git
cd githubActionAutomation
mvn spring-boot:run

Option 2 — Docker

docker build -t devops-cicd-demo .
docker run -p 8080:8080 devops-cicd-demo

Option 3 — Docker Compose

docker-compose up --build

Test the endpoints

# Health check
curl http://localhost:8080/api/health

# App info
curl http://localhost:8080/api/info

# Spring Actuator
curl http://localhost:8080/actuator/health

Setting Up the Pipeline (GitHub Secrets Required)

Go to your repo → Settings → Secrets and variables → Actions and add:

Secret Description
DOCKERHUB_USERNAME Your Docker Hub username
DOCKERHUB_TOKEN Docker Hub access token
STAGING_HOST Staging server IP or hostname
STAGING_USER SSH username for staging
STAGING_SSH_KEY Private SSH key for staging
PROD_HOST Production server IP or hostname
PROD_USER SSH username for production
PROD_SSH_KEY Private SSH key for production

What This Demonstrates

  • Automated build, test, and quality gate on every commit
  • Multi-stage Docker builds for minimal production image size
  • Multi-architecture images (amd64 + arm64)
  • Environment-based deployment (staging on develop, production on main)
  • SSH-based deployment with health check validation
  • GitHub Release auto-created on every production deploy
  • Test reporting with JUnit XML artifacts
  • Dependency caching for faster builds

Author

Kumari Rashmi — DevOps Engineer
Freelancer.de Profile · LinkedIn · GitHub

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors