MapleCMS uses a fully automated CI/CD pipeline to deploy both its Next.js frontend and FastAPI backend to AWS. This document explains the entire flow — from local commits to production deployment.
MapleCMS follows a modern DevOps pipeline using GitHub Actions, Docker, Terraform, and AWS ECS/ECR.
Developer → GitHub Push → CI (Build + Test) → Docker Build → ECR → ECS Deploy → Live Site
Each step is automated to ensure reliable, repeatable, and zero-downtime deployments.
- Triggered on every
pushorpull_requesttomainordevbranch.
- Checkout Repository – Pull latest code.
- Set up Environments – Configure Python, Node.js, AWS credentials.
- Install Dependencies –
npm installandpip install -r requirements.txt. - Run Tests – Unit & integration tests for both frontend and backend.
- Build Docker Images – Create container images for
frontendandbackend. - Push to AWS ECR – Tag & upload images to Elastic Container Registry.
Example GitHub Actions job:
name: CI Build
on:
push:
branches: [main, dev]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
cd frontend && npm ci
cd ../backend && pip install -r requirements.txt
- name: Run tests
run: |
cd backend && pytest
cd ../frontend && npm run test
- name: Build Docker images
run: |
docker build -t maplecms-frontend:latest ./frontend
docker build -t maplecms-backend:latest ./backend| Component | Service | Purpose |
|---|---|---|
| Compute | ECS (Elastic Container Service) | Runs containers in Fargate mode |
| Registry | ECR (Elastic Container Registry) | Stores Docker images |
| Storage | S3 | Media uploads + static assets |
| Database | RDS (PostgreSQL) | Content + user data |
| Networking | CloudFront + ALB | CDN and load balancing |
- Terraform Apply – Provisions ECS, RDS, and networking infrastructure.
- ECS Service Update – Pulls the latest Docker image from ECR.
- Smoke Tests – Confirms deployment health.
- Notifications – Sends deployment status to Slack/Email.
Terraform manages all AWS resources declaratively.
Modules:
ecs/→ Cluster + Servicesrds/→ PostgreSQL instances3/→ Buckets for media and static assetscloudfront/→ CDN + SSLiam/→ Role & policy management
Commands:
terraform init
terraform plan
terraform apply -auto-approve- Secrets managed via AWS Secrets Manager.
- GitHub secrets for CI/CD credentials (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY). - HTTPS enforced by AWS ACM certificates.
- Principle of least privilege applied for all IAM roles.
| Environment | Branch | Infrastructure | Notes |
|---|---|---|---|
| Dev | dev |
Staging ECS + RDS | Auto-deployed on merge |
| Prod | main |
Production ECS + RDS | Manual approval required |
Manual promotion between environments ensures stable releases.
- Use
terraform destroy -target=aws_ecs_service.maplecms_backend(to redeploy previous version) - Previous Docker images are versioned in ECR.
- AWS CloudWatch for logs, CPU, and latency.
- Optional Prometheus + Grafana for visualization.
- Alert notifications through AWS SNS.
- GitHub Actions for CI/CD automation.
- Terraform for infrastructure as code.
- AWS ECS + ECR for scalable, containerized hosting.
- Secure secrets and zero-downtime deploys.
MapleCMS CI/CD ensures reliability, speed, and simplicity — empowering developers to deploy confidently with every commit.