A lightweight, custom-built CI/CD pipeline that automates deployments from GitHub to a self-hosted Ubuntu VPS using Github Webhooks, FastAPI, and PM2.
-
Push: Code is pushed to the main branch on GitHub.
-
Trigger: GitHub sends a POST request to https://webhook.yourdomain.com.
-
Listen: Nginx proxies the request to a local FastAPI server running on port 8000.
-
Verify: Python verifies the HMAC SHA-256 signature using a shared secret.
-
Deploy: Upon verification, a Bash script is triggered to pull code, build, and reload the application via PM2.