GitHub Actions
GitHub Actions is where most static sites on this site are built, tested and deployed from, so its guides are about the pipeline itself rather than any one generator: caching dependencies and generator output between runs, fanning out over many sites with matrix builds, sharing one pipeline across repositories with reusable workflows, cancelling superseded runs, and pinning third-party actions so a moved tag cannot change what runs with your deploy credentials.
Every guide reports CI minutes and wall-clock time before and after, because a pipeline change that makes builds safer but twice as slow tends to get reverted.
Choosing the Right Static Site Generator for Production
- Deploying Jekyll with GitHub ActionsHow-toReplace the classic GitHub Pages Jekyll builder with a GitHub Actions workflow: any plugin, any Jekyll version, caching, previews and Pages deployment.
- Parallel Hugo Builds Across CI JobsHow-toSplit a very large Hugo site into segments built in parallel CI jobs, merge the output safely, and measure when parallel builds beat a single larger runner.
Core Web Vitals Optimization for SSGs
- Setting Up Lighthouse CI for a Static SiteHow-toWire Lighthouse CI into GitHub Actions against every preview deploy: URL selection, assertions, a required status check and stored reports, in about an hour.
Production-Ready Deployment & CI/CD for SSGs
- Automating Preview Deploy Pipelines with GitHub ActionsHow-toBuild an ephemeral per-PR preview pipeline in GitHub Actions — build the SSG, deploy to a unique URL, comment the link, and tear it down when the PR closes.
- Building Astro Sites with GitHub ActionsHow-toA production GitHub Actions workflow for Astro: pinned Node, dependency and image caches, astro check, build artifacts and a deploy job that only runs on main.
- Caching Hugo Builds in GitHub ActionsHow-toCache Hugo resources/_gen and the module cache in GitHub Actions with content-hashed keys. Includes the workflow, cache key design, and measured CI minutes saved.
- Caching node_modules in GitHub ActionsHow-toCut SSG CI time by caching npm in GitHub Actions — actions/setup-node built-in cache vs actions/cache, lockfile-hash keys, and the install minutes you actually save.
- Concurrency Groups to Cancel Stale BuildsHow-toUse GitHub Actions concurrency groups to cancel superseded static site builds on pull requests, serialize production deploys, and cut wasted CI minutes.
- Deploying to Cloudflare From GitHub Actions With WranglerHow-toDeploy a static site to Cloudflare Workers Static Assets or Pages from GitHub Actions with Wrangler: scoped tokens, PR previews, caching and rollback.
- GitHub Actions for Hugo DeploymentsHow-toDeploy Hugo with GitHub Actions using the extended edition for SCSS and WebP — a two-job build-and-publish pipeline, resource caching, and the Hugo-specific gotchas.
- Matrix Builds for Multi-Site MonoreposHow-toBuild and deploy only the sites a change affects in a monorepo, using a dynamic GitHub Actions matrix generated from changed paths, with per-site caches.
- Pinning Actions by Commit SHAHow-toPin third-party GitHub Actions in static site workflows to full commit SHAs, keep them updated with Renovate or Dependabot, and restrict which actions may run.
- Publishing Any Generator to GitHub Pages With ActionsHow-toOne reusable GitHub Actions workflow that publishes Hugo, Astro, Eleventy, Jekyll or VitePress sites to GitHub Pages, with base paths, caching and a 404 page.
- Pull Request Previews for GitHub Pages SitesHow-toGive a GitHub Pages site a preview per pull request: deploy builds to a preview host or a subfolder, comment the URL, handle base paths and clean up on close.
- Reusable Workflows for SSG BuildsHow-toShare one build, test and deploy pipeline across many static sites with GitHub Actions reusable workflows and composite actions, versioned and called by tag.
- Scheduled Content Publishing With GitHub ActionsHow-toPublish reviewed pull requests at a set time with GitHub Actions, for embargoed launches and releases, with time zones, approvals and failed-build guards.
- Securing Deploy Credentials with GitHub OIDCHow-toReplace long-lived deploy tokens with short-lived OIDC credentials in GitHub Actions for AWS, Cloudflare and Netlify, scoped to one branch and one deploy job.
- Zero-Downtime Deploys with Symlink SwapsHow-toDeploy a static site to a VM atomically: one directory per release, an atomic symlink swap, one-second rollback, retention and a GitHub Actions workflow.
- Fixing Flaky Static Site Builds in GitHub ActionsFixTrack down static site builds that fail intermittently in GitHub Actions, from network fetches and cache races to memory limits and timing tests.
Often used with GitHub Actions
- GitHub Pages3 shared guidesPublishing from Actions and custom domains.
- Hugo3 shared guidesBuild time at scale, image caches, modules and multilingual sites.
- Cloudflare2 shared guidesPages and Workers hosting, cache rules and edge functions.
- Jekyll1 shared guidesPlugins, reproducible builds, upgrades and migration away.
- Lighthouse1 shared guidesBudgets, Lighthouse CI and lab against field data.
- Astro1 shared guidesIslands, content collections, astro:assets and deployment.