The system needed to run on both AWS EC2 and an on-premise government server simultaneously — with both code and data staying in sync — without manual intervention or risking divergence between the two environments.
Solution
GitHub Actions CI/CD pipeline deploys to both servers on every push to main. AWS RDS streams data to the on-premise PostgreSQL via logical replication, and S3 image assets are synced to local on-premise storage on a scheduled job — keeping both environments identical without manual effort.
