Host multiple static-site generators (SSGs) side-by-side on a single EC2 instance using Terraform, Docker/Nginx, and GitHub Actions.
Region: us-east-2 (Ohio)
Paths served: /jekyll/, /hugo/, /eleventy/, /astro/ (optional landing page at /)
- Terraform
Provisions a small EC2 (Amazon Linux 2) inus-east-2, opens HTTP :80 to the world and SSH :22 only to your current IP, and installs Docker via cloud-init. - Nginx (Docker)
Runs stocknginx:alpine; mounts your content fromapp/and two configs:nginx/99-no-cache.conf→ http-level “no cache” headersnginx/default.conf→ server block that routes/jekyll,/hugo,/eleventy,/astro
- GitHub Actions
.github/workflows/deploy.yml(push tomain): uploadsapp/**+ both Nginx confs over SSH, recreates the container, smoke-tests port 80, then cleans up..github/workflows/pr-check.yml(PRs/feature branches): checks Terraform format/validate (no backend), validates Nginx config inside a container, and can test-build locally (no push).
No custom Docker image is required in production: we run stock
nginx:alpineand mount your files.