Blue-Green Deployment Strategy

The backend will run on two ports:

Version Port
Blue 8080
Green 8081

Only one version is LIVE at a time.

When a new version is deploying:

  1. Users keep using the old version
  2. New version starts in background
  3. When new version is healthy → switch traffic
  4. Old version is stopped

Zero downtime achieved!

GitHub Actions Flow

When you push to the main branch:

Step 1: GitHub Builds Your App

./mvnw clean package

This produces: bootstrap-0.0.1-SNAPSHOT.jar

Step 2: GitHub Uploads the JAR to VPS

GitHub uses SCP (secure file copy) to transfer the JAR file.

Step 3: GitHub SSH to VPS and Runs Deployment Script

This is where Blue-Green deployment happens: