Skip to content

About

End-to-end AWS DevOps CI/CD pipeline using GitHub Actions, Docker, Amazon ECR, and EC2 for automated container deployment.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ CloudDeploy - AWS DevOps CI/CD Pipeline

AWS Docker GitHub Actions Python Flask !

πŸ“Œ Project Overview

CloudDeploy is an end-to-end DevOps project demonstrating a production-style Continuous Integration and Continuous Deployment (CI/CD) pipeline on AWS.

The project automatically builds a Docker image whenever code is pushed to GitHub, stores the image in Amazon ECR, and deploys the latest version to an AWS EC2 instance using GitHub Actions.

This project demonstrates modern DevOps practices including containerization, automation, cloud deployment, and CI/CD.


πŸ— Architecture

Developer
     β”‚
     β–Ό
Git Push
     β”‚
     β–Ό
GitHub Repository
     β”‚
     β–Ό
GitHub Actions
     β”‚
     β–Ό
Docker Image Build
     β”‚
     β–Ό
Amazon Elastic Container Registry (ECR)
     β”‚
     β–Ό
SSH into EC2
     β”‚
     β–Ό
Pull Latest Docker Image
     β”‚
     β–Ό
Stop Previous Container
     β”‚
     β–Ό
Run Latest Container
     β”‚
     β–Ό
Application Live

πŸš€ Features

  • Automated CI/CD Pipeline
  • Dockerized Flask Application
  • GitHub Actions Workflow
  • Amazon ECR Integration
  • Automated EC2 Deployment
  • Dynamic Deployment Dashboard
  • Health Check Endpoint
  • Responsive Professional UI
  • Zero Manual Deployment
  • Production-ready Gunicorn Server

πŸ“‚ Project Structure

devops-cicd-project/
β”‚
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ .dockerignore
β”‚   β”œβ”€β”€ deployment.json
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── index.html
β”‚   └── static/
β”‚       β”œβ”€β”€ css/
β”‚       β”‚   └── style.css
β”‚       β”œβ”€β”€ js/
β”‚       β”‚   └── app.js
β”‚       └── images/
β”‚
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml
β”‚
β”œβ”€β”€ scripts/
β”‚   └── deploy.sh
β”‚
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ README.md
└── LICENSE

πŸ›  Technologies Used

Cloud

  • AWS EC2
  • Amazon ECR
  • IAM

DevOps

  • Docker
  • GitHub Actions
  • Git
  • CI/CD

Backend

  • Python
  • Flask
  • Gunicorn

Frontend

  • HTML5
  • CSS3
  • JavaScript

βš™ CI/CD Workflow

  1. Developer pushes code to GitHub.
  2. GitHub Actions workflow starts automatically.
  3. Repository is checked out.
  4. Docker image is built.
  5. Image is tagged.
  6. Image is pushed to Amazon ECR.
  7. GitHub Actions connects to the EC2 instance using SSH.
  8. EC2 logs in to Amazon ECR.
  9. Latest Docker image is pulled.
  10. Existing container is stopped.
  11. Old container is removed.
  12. New container is started.
  13. Updated application becomes available.

πŸ“¦ Docker

Build Image

docker build -t clouddeploy:v1 .

Run Container

docker run -d \
--name clouddeploy \
-p 5000:5000 \
clouddeploy:v1

Stop Container

docker stop clouddeploy

Remove Container

docker rm clouddeploy

☁ AWS Services Used

  • Amazon EC2
  • Amazon ECR
  • IAM

πŸ” GitHub Secrets

Configure the following repository secrets before running the workflow.

Secret Description
AWS_ACCESS_KEY_ID IAM User Access Key
AWS_SECRET_ACCESS_KEY IAM User Secret Key
AWS_ACCOUNT_ID AWS Account ID
AWS_REGION AWS Region
ECR_REPOSITORY Amazon ECR Repository Name
EC2_HOST EC2 Public IP or DNS
EC2_USERNAME SSH Username
EC2_SSH_KEY EC2 Private Key

πŸš€ Local Setup

Clone the repository.

git clone <repository-url>

Move into the application directory.

cd devops-cicd-project/app

Install dependencies.

pip install -r requirements.txt

Run the application.

python app.py

Open your browser.

http://localhost:5000

🐳 Docker Compose

Start the application.

docker compose up --build

Run in background.

docker compose up -d

Stop the application.

docker compose down

πŸ“‘ API Endpoints

Home

GET /

Displays the deployment dashboard.


Health Check

GET /health

Returns application health status.


Deployment Information

GET /api/deployment

Returns deployment metadata in JSON format.


πŸ“ˆ Future Improvements

  • Kubernetes Deployment
  • Amazon EKS
  • Helm Charts
  • Terraform Infrastructure
  • Blue/Green Deployment
  • Canary Deployment
  • Monitoring with CloudWatch
  • Prometheus
  • Grafana
  • SonarQube
  • Trivy Security Scanning
  • Slack Notifications
  • Automatic Rollback
  • Multi-stage Docker Builds
  • Image Versioning using Git SHA

πŸ“· Screenshots

Add screenshots of:

  • Application Dashboard
  • GitHub Actions Workflow
  • Amazon ECR Repository
  • Running EC2 Instance
  • Docker Containers
  • Successful Deployment

πŸ‘¨β€πŸ’» Learning Outcomes

Through this project you will learn:

  • Git & GitHub
  • Docker Fundamentals
  • Docker Image Management
  • GitHub Actions
  • CI/CD Pipeline Design
  • AWS EC2
  • Amazon ECR
  • IAM Configuration
  • SSH Automation
  • Deployment Automation
  • Production Deployment Practices

πŸ‘€ Author

Suyash Singh

DevOps Engineer | Cloud Enthusiast | AWS | Docker | Linux | CI/CD

GitHub: https://github.com/Suyashrsingh

LinkedIn: https://www.linkedin.com/in/suyash-rishi-singh-6bb18b289/


⭐ Support

If you found this project useful:

  • ⭐ Star the repository
  • 🍴 Fork the project
  • πŸ“’ Share it with others
  • πŸ’‘ Contribute with improvements

Happy Learning! πŸš€

About

End-to-end AWS DevOps CI/CD pipeline using GitHub Actions, Docker, Amazon ECR, and EC2 for automated container deployment.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages