Skip to content

Test your website now

Free, no card. We read only public pages.

Run free audit →

Hosting and deploy

How do you host a website on GitHub Pages?

GitHub Pages hosts static sites free from a repository. How to publish, add a custom domain and HTTPS, deploy a React or Vite app, and the limits to know first.

GitHub Pages hosts static websites from a GitHub repository, free for public repositories. Enable it in Pages settings and choose a branch or GitHub Actions workflow to publish. GitHub assigns an address based on your account and repository. Custom domains and HTTPS are supported, but server-side application code cannot run there, and usage limits apply.

Published · Last updated

By Michal Měřínský. Audit methodology.

How to publish

  • Create a repository with your site's files, or with a build setup.
  • Go to Settings, then Pages.
  • Choose the source: deploy from a branch, for plain HTML, or GitHub Actions, for sites that need a build step.
  • GitHub assigns a github.io address based on the account and repository names. Use the exact published address shown in Pages settings; a custom domain might instead be https://site.example/project.

Deploying a React or Vite app

  • Use a GitHub Actions workflow that runs npm run build and publishes the output folder. GitHub provides starter workflows for common tools.
  • For a project site under /repository/, set the base path in your build config, such as base in vite.config, or assets will load from the wrong path.
  • GitHub Pages has no single-page app fallback. Client-side routes return 404 on direct visits unless you use a 404.html workaround or hash-based routing.

Custom domain and HTTPS

  • Add the domain in the Pages settings, which writes a CNAME file to the repository.
  • At your DNS provider, point www with a CNAME to account.example, and the bare domain with A records to GitHub's Pages IP addresses listed in the documentation.
  • Verify the domain in your account settings to prevent takeover.
  • Tick Enforce HTTPS once the certificate is issued.

Limits to know first

  • Static files only: no server code, no database, no server-side API keys.
  • Published sites may be no larger than 1 GB, with a soft bandwidth limit of 100 GB per month and a soft limit of 10 builds per hour.
  • Free for public repositories. Pages from private repositories need a paid GitHub plan.
  • GitHub's terms say Pages is not intended as free hosting for an online business, e-commerce site or software as a service.

Everything in a GitHub Pages site, and in a public repository, is public. Never commit API keys, even in a file you think is not served.

What a scan can and cannot tell you

WebAuditOS checks a GitHub Pages site like any other: HTTPS and redirects, a sitemap, a real 404 for unknown URLs, and everything else on the page.

It does not see your repository or workflow, so it cannot tell you a build failed. It can only see that the site did not change.

If a scan finds 404s on routes that work when you click through the app, the missing single-page app fallback is the cause.

Short answers

Is GitHub Pages free? Yes, for public repositories.

Can GitHub Pages run a backend? No. Use a backend service or another host for server code.

Can I use my own domain? Yes, with free HTTPS.

Why do my React routes 404 on GitHub Pages? Pages has no fallback to index.html. Use a 404.html workaround or hash routing.

In the product

The checks this maps to

Every check named here runs on every scan, on every plan - what a plan changes is how many pages are crawled, how long the history is kept and what you can do with the result. These are the ids the findings carry, so you can match a line in a report to the explanation above.