Should I use GitHub Actions/Pages or Netlify for Eleventy + Sanity deployment?
GitHub Pages is a totally reasonable choice for hosting your Eleventy + Sanity site! There's no strong technical reason you shouldn't use it, especially if you're already comfortable with GitHub Actions. That said, let me break down some considerations to help you make an informed decision.
GitHub Pages + Actions can absolutely work
You can set up an Eleventy site on GitHub Pages using GitHub Actions for the build process. The basic workflow would be:
- Your Eleventy site pulls content from Sanity via GROQ queries at build time
- GitHub Actions builds your site when you push to your repo
- The built site deploys to GitHub Pages
The rebuild trigger challenge
The main friction point you'll encounter is triggering rebuilds when you update content in Sanity. When you publish a blog post in Sanity Studio, you'll want your site to automatically rebuild. This is where things get slightly more complex with GitHub Pages compared to Netlify.
For automatic rebuilds from Sanity, you have two modern options:
Option 1: Sanity Functions (recommended modern approach)
Sanity Functions are serverless functions that run within Sanity's infrastructure. You can set up an event handler that triggers when content changes, which then calls GitHub's API to trigger a workflow. This requires you to use GitHub's repository_dispatch event in your Actions workflow. You'd need to set up a personal access token from GitHub and configure it in your Function.
Option 2: Webhooks (traditional approach)
You can configure a webhook in Sanity to hit a GitHub Actions workflow endpoint. This also uses repository_dispatch and requires similar setup with authentication tokens and custom headers (like authorization bearer tokens).
Both approaches require you to handle API tokens and a bit of configuration, which might be slightly outside your comfort zone, but they're well-documented patterns.
Key differences: GitHub Pages vs Netlify
GitHub Pages limitations:
- No deploy previews: This is the big one. GitHub Pages doesn't have built-in preview deployments for pull requests with ephemeral URLs like Netlify does. You only have your production site.
- No redirects/headers: GitHub Pages doesn't support
_redirectsor_headersfiles for custom redirects or HTTP headers - No forms/functions: No built-in form handling or serverless functions (though you won't need this for a basic Eleventy site)
- Bandwidth/storage limits: GitHub Pages has soft limits of 100GB bandwidth per month and 1GB repository size, which is usually fine for personal sites
Netlify advantages:
- Deploy previews: Automatic preview deployments for every pull request with unique URLs
- Simpler webhook setup: Netlify provides a build hook URL that you can directly add to Sanity's webhook settings - no authentication tokens needed
- Redirects and headers: Full support for
_redirectsand_headersfiles - Generous free tier: 100GB bandwidth, 300 build minutes per month (as of 2025)
My honest take
For a personal site where you're not collaborating with others and don't need deploy previews, GitHub Pages is fine! The main hassle is the webhook/function setup for automatic rebuilds, but once configured it works reliably.
However, Netlify's popularity in the Jamstack community exists for good reasons - the deploy preview feature is incredibly useful even for personal sites (you can preview changes before publishing), and the webhook setup is genuinely simpler (just paste a URL into Sanity, no tokens needed).
If you're already comfortable with GitHub Actions, you're probably capable of setting up the repository_dispatch webhook, but be prepared for a bit more configuration complexity compared to Netlify's "paste this URL" approach.
Resources to help:
- Eleventy's official deployment docs cover GitHub Pages setup
- GitHub's
repository_dispatchdocumentation explains how to trigger workflows via webhooks - Look for "Eleventy Sanity starter" repos on GitHub for examples of this setup
Since you're not a developer and want to minimize friction, I'd honestly suggest trying Netlify first - the simpler webhook setup and deploy previews might save you headaches. But if you want to stick with GitHub for everything, it's definitely doable! Welcome to the Sanity community, and congrats on ditching WordPress! 🎉
Show original thread9 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.