How this site is built and deployed
A static site on Azure Static Web Apps, with every piece of infrastructure in Terraform, deployments federated through OIDC and a running cost of zero.
Context
This site is my portfolio, and also a small, complete example of how I build platforms: the same practices I use at work, sized for one static site.
Constraints
- Close to zero running cost. The domain is the only recurring expense.
- No stored cloud credentials anywhere.
- Every change goes through a pull request with a preview before it reaches production.
- Maintainable by one person.
Why not…
- Kubernetes or containers? A static site has nothing to run. A cluster would add cost and upkeep without serving a single page better.
- A deployment token stored in GitHub? It would be a long-lived secret. The workflow signs in through OIDC and fetches the token only at run time.
- Cloudflare’s proxy in front? Spanish ISPs block shared Cloudflare addresses on football match days, and the proxy’s WAF could be bypassed through the app’s own hostname anyway. For static files, being reachable matters more.
Solution
- Astro builds the site into plain HTML from Markdown. No server, no database.
- Azure Static Web Apps (Free plan) hosts it, with managed certificates and a preview environment for each pull request.
- Cloudflare is the registrar and DNS. The domain points straight at Azure; Cloudflare only
redirects
wwwto it. - GitHub Actions builds, lints and checks links on every pull request, then deploys. It signs in to Azure through OIDC federation as a managed identity whose only permission is to read the app and its deployment token.
- Terraform manages everything in Azure and Cloudflare. Each change is a reviewed plan before it is applied.
Outcome
- Running cost: 0 € a month. A budget alerts on the first cent.
- No stored Azure credentials. The one stored secret is a Cloudflare token scoped to this zone, because Cloudflare offers no federation.
- Every change is a pull request with its own preview environment.