Portfolio Site

this site, built with astro and served from s3 and cloudfront

source

This site is a static Astro site served from Amazon S3 and CloudFront at ineedmoreinformation.com. Every push to master is checked, built and deployed by GitHub Actions in under a minute, without any stored AWS credentials. It started as a Jekyll site on GitHub Pages; this blog post covers how and why it moved.

Tech Stack

Layer Technology
Site Astro 7 (static output), TypeScript 6
Content Markdown and YAML in content collections, with front matter validated by Zod schemas
Styling Tailwind CSS 4, self-hosted Roboto, Font Awesome icons rendered to inline SVG at build time
Markdown Astro’s Sätteri processor, Shiki syntax highlighting with light and dark themes
Hosting Amazon S3 (private), CloudFront, ACM, Route 53
Infrastructure AWS CDK in TypeScript
CI/CD GitHub Actions, GitHub OIDC to an IAM role
Upkeep Dependabot, with grouped weekly and monthly updates

Architecture

Components

Request sequence

Request sequence when a visitor loads a page The browser resolves the domain in Route 53, which returns the nearest CloudFront edge. The browser requests the page over HTTPS. A CloudFront Function rewrites the path to an index.html key. On a cache miss CloudFront fetches the object from the private S3 bucket through Origin Access Control, then returns the HTML with security headers. Hashed assets are then served from the edge cache. Browser Route 53 CloudFront CF Function S3 bucket DNS lookup, A / AAAA alias → nearest edge GET /blog/ · TLS with ACM certificate viewer request /blog/index.html cache miss: GetObject, signed by OAC index.html HTML + security headers · HTTP/2 or 3 GET /_astro/* (CSS, fonts) from edge cache · 1 year, immutable
On a cache hit CloudFront answers from the edge and never calls S3. Requests for www or a path without a trailing slash get a 301 from the Function instead of a rewrite.

Deployment

Site changes (automatic)

  1. Pull request: GitHub Actions installs dependencies with npm ci, type-checks with astro check, builds, and runs a URL check that fails if any page from the original site is missing from the build. Nothing deploys.
  2. Merge to master: the same checks run, then the deploy job starts. A newer push cancels a deploy that’s still running, so only the latest commit goes out.
  3. Sign in: the deploy job asks GitHub for an OIDC token and exchanges it with AWS STS for one-hour credentials. The IAM role only accepts tokens for this repository’s immutable owner and repo IDs on master. A renamed repo, a fork, or a new repo reusing the name can’t assume it.
  4. Upload: aws s3 sync --delete uploads the build twice. The _astro/ assets have content-hashed names and get a one-year immutable cache. Everything else (HTML, feeds, the resume PDF) tells browsers to revalidate and lets CloudFront cache it for a day.
  5. Invalidate: a CloudFront invalidation of /* makes the new HTML live at the edge within a minute or so.

The deploy role can list, put and delete objects in the site bucket and invalidate the site distribution, and nothing else. The role ARN, bucket and distribution ID are repository secrets, so GitHub masks them in the public logs.

Infrastructure changes (manual, rare)

The infrastructure is a CDK app in infra/.

  1. Configure: account-specific settings live in a gitignored infra/.env: domain, hosted zone, the repository in its immutable owner@ownerId/repo@repoId form, deploy branch, and budget. infra/.env.example lists them. The app checks every value before it builds a template, and rejects a plain owner/repo.
  2. Review: npx cdk diff shows exactly what will change.
  3. Apply: npx cdk deploy with an AWS profile. The stack has termination protection, and the template never contains the account ID.
  4. First deploy only: copy the three stack outputs (bucket name, distribution ID, deploy role ARN) into the repository secrets the workflow reads.

Deploy sequence

Deploy sequence on a push to master GitHub Actions requests an OIDC token from GitHub, exchanges it with AWS STS for temporary credentials, syncs hashed assets and then everything else to S3, and creates a CloudFront invalidation. GitHub Actions GitHub OIDC AWS STS S3 bucket CloudFront request token JWT, subject = repo IDs AssumeRoleWithWebIdentity temporary credentials (1 hour) sync _astro/ · cache 1 year, immutable sync everything else · revalidate create invalidation /*

Estimated Cost

Item Estimate
Route 53 hosted zone $0.50 / month
Domain registration (.com) about $15 / year (~$1.25 / month)
CloudFront requests, transfer and Function invocations $0, inside the always-free tier
S3 storage and requests (under 2 MB stored) a few cents
ACM certificate, DNS alias queries, invalidations, the budget $0
Total about $1.75 / month

The original GitHub Pages site cost nothing. The new cost is almost entirely the domain. Estimates use AWS list prices as of November 2026.

Highlights

How it got here: blog →