Skip to content

Repository files navigation

Self-Healing DevOps Pipeline with Automated Rollback

DevOps Pipeline using GitHub Actions & Docker



Micro Project - DevOps
Alliance University, Bengaluru


📖 Project Overview

This project demonstrates an Automated Rollback Mechanism for failed deployments in a DevOps CI/CD pipeline using GitHub Actions and Docker.

The system automatically detects deployment failures through health checks and restores the last stable version of the application without manual intervention. This helps improve reliability, reduce downtime, and ensure continuous application availability.


🎯 Problem Statement

Analyze and create an Automated Rollback Mechanism for failed deployments in DevOps pipelines.

Frequent deployments can introduce failures due to bugs, configuration issues, or runtime errors. Recovering manually from such failures increases downtime and operational effort. This project addresses the problem by implementing a fully automated rollback workflow.


🛠️ Technologies Used

Technology Purpose
GitHub Actions CI/CD Pipeline Automation
Docker Application Containerization
Docker Compose Container Deployment
Node.js Backend Runtime
Express.js Web Application Framework
Git & GitHub Version Control
Curl Health Check Validation

🏗️ System Architecture

Developer Pushes Code
          │
          ▼
GitHub Repository
          │
          ▼
GitHub Actions Pipeline
          │
          ▼
Build Docker Image
          │
          ▼
Deploy Application
          │
          ▼
Health Check
          │
     ┌────┴────┐
     │         │
 Success    Failure
     │         │
     ▼         ▼
 Stable    Rollback
 Version   Triggered
     │         │
     └────┬────┘
          ▼
 Application Running

⚙️ CI/CD Workflow

1️⃣ Code Push

Whenever code is pushed to the main branch, GitHub Actions automatically starts the workflow.

2️⃣ Docker Image Build

docker build -t rollback-app:latest .

3️⃣ Deployment

docker compose up -d

4️⃣ Health Check

curl http://localhost:3000

5️⃣ Failure Simulation

curl http://localhost:3000/crash

This intentionally crashes the application to test rollback functionality.

6️⃣ Automated Rollback

If the health check fails:

  • Failed container is stopped
  • Stable version is restored
  • Application is redeployed automatically

7️⃣ Verification

Version 1 - App is Working

📊 Workflow Execution Results

✅ Successful Deployment

Version 1 - App is Working

❌ Failed Deployment

curl: (52) Empty reply from server

🔁 Rollback Verification

Rollback triggered...
Version 1 - App is Working

🔥 Key Features

  • Automated CI/CD Pipeline
  • Docker-based Deployment
  • Health Check Validation
  • Failure Detection
  • Automatic Rollback
  • Zero Manual Recovery
  • GitHub Actions Integration

📈 Benefits

✅ Reduced Downtime

✅ Improved Reliability

✅ Faster Recovery

✅ Automated Deployment Validation

✅ Real-World DevOps Practice


📚 Learning Outcomes

Through this project, the following concepts were implemented and understood:

  • CI/CD Pipeline Design
  • GitHub Actions Workflow Automation
  • Docker Containerization
  • Health Check Monitoring
  • Deployment Failure Handling
  • Rollback Strategies
  • DevOps Best Practices

🔮 Future Enhancements

  • Docker Hub Integration
  • AWS Deployment
  • Kubernetes Support
  • Blue-Green Deployment
  • Canary Deployment
  • Monitoring with Prometheus & Grafana

👨‍💻 Author

ES Sriram

B.Tech – Computer Science & Engineering (Cloud Computing)

Alliance University, Bengaluru



⭐ If you found this project useful, consider starring the repository.

About

Automated rollback mechanism for failed deployments using GitHub Actions, Docker, and CI/CD pipelines with health check validation and recovery.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages