GitHub Pages is a static site hosting service built into GitHub that publishes HTML, CSS, JavaScript and other static files directly from a repository to a public web address. In hosting for servers and web projects, it represents the simplest form of Git-based deployment: a push to a chosen branch, or a successful GitHub Actions workflow, becomes a live website without any server to manage.
The service is widely used for project documentation, personal portfolios, open source websites and technical blogs. It does not run server-side code or databases, so its strengths and limits both come from the static model it shares with Netlify, Vercel and Cloudflare Pages.
How GitHub Pages publishes a website
GitHub Pages takes files from a repository, optionally runs a build step, and serves the output through a global content delivery network. The publishing source is either a branch and folder, such as the root or a /docs directory, or a custom GitHub Actions workflow that builds the site and uploads it as an artifact.
In branch-based publishing, GitHub can process the content with Jekyll, a Ruby static site generator, unless the repository contains a .nojekyll file. With Actions-based publishing, any generator can be used, including Hugo, Astro, Docusaurus, MkDocs or a plain Node.js build, which gives teams full control over the toolchain.
The table below shows the three common publishing setups and what each one is best suited for.
| Publishing source | Build process | Generator choice | Best for |
|---|---|---|---|
| Branch root | Optional built-in Jekyll | Jekyll or prebuilt files | Simple personal or project pages |
| Branch /docs folder | Optional built-in Jekyll | Jekyll or prebuilt files | Documentation beside source code |
| GitHub Actions workflow | Custom workflow steps | Any static site generator | Modern frameworks and complex builds |
Site types, addresses and custom domains
GitHub Pages distinguishes user or organization sites from project sites, and the type determines the default address. Each account can have one user or organization site, while every repository can publish its own project site under a path of that address.
The following table summarizes the address patterns and their typical purpose.
| Site type | Repository | Default address | Typical purpose |
|---|---|---|---|
| User site | username.github.io | username.github.io | Portfolio or personal blog |
| Organization site | orgname.github.io | orgname.github.io | Company or community homepage |
| Project site | Any repository | username.github.io/repository | Documentation for one project |
A custom domain is configured in the repository settings and in DNS. A subdomain such as docs.example.com uses a CNAME record pointing to the github.io address, while an apex domain uses A or AAAA records for the GitHub Pages addresses. Once DNS resolves correctly, GitHub can issue a free TLS certificate from Let’s Encrypt, and the Enforce HTTPS option redirects all plain HTTP requests.
Verifying the custom domain at the account or organization level is strongly recommended. Without verification, a dangling DNS record left after a repository is deleted can allow another user to take over the subdomain and publish content under it.
Usage limits and policy restrictions
GitHub Pages is free for public repositories on all plans, and private repositories can publish sites on paid GitHub plans. The service applies soft limits intended to keep it a hosting tool for projects rather than a general commercial platform; exceeding them may lead to a request to reduce usage rather than an immediate shutdown.
The values below reflect commonly documented limits; they can change and should be confirmed before planning a large site.
| Limit | Typical value | What it affects |
|---|---|---|
| Published site size | Up to 1 GB | Total size of the deployed output |
| Source repository size | 1 GB recommended | Clone speed and build reliability |
| Bandwidth | About 100 GB per month, soft | Very high traffic sites |
| Branch-based builds | About 10 per hour, soft | Frequent automated commits |
| Deployment timeout | About 10 minutes | Long or heavy builds |
The terms also state that the service is not intended for online businesses, e-commerce sites or software as a service. Sending passwords or payment data through a GitHub Pages site is prohibited, which reflects its role as public static hosting.
GitHub Pages compared with other static hosting platforms
GitHub Pages is the most tightly integrated with the repository, whereas dedicated static platforms offer more deployment features. The trade-off is usually simplicity and zero cost versus preview deployments, serverless functions and finer control over headers and redirects.
The comparison below covers features that most often decide the choice.
| Platform | Server-side functions | Preview deployments | Custom headers and redirects |
|---|---|---|---|
| GitHub Pages | No | Not built in | Very limited |
| Netlify | Yes | Yes, per pull request | Yes, through configuration files |
| Vercel | Yes | Yes, per pull request | Yes, through configuration files |
| Cloudflare Pages | Yes, through Workers | Yes, per branch | Yes, through configuration files |
For a documentation site, a library homepage or a portfolio, these gaps rarely matter. For applications that need authentication, form processing or API routes, a platform with functions, or a traditional server, is the better fit.
Common mistakes and practical limitations
Most problems with GitHub Pages come from path handling, DNS configuration and build assumptions rather than from the service itself. Project sites live under a subpath, so assets referenced with absolute paths such as /style.css often fail until the base URL is set in the generator.
- Missing base path settings break CSS, images and links on project sites.
- Client-side routing in single-page applications returns 404 errors on reload unless a fallback strategy is used.
- Unverified custom domains leave an opening for subdomain takeover.
- Secrets committed to the repository become public along with the site.
- Expecting server code such as PHP or databases to run, which the service never supports.
Caching through the CDN also means that updates can take a few minutes to appear, so deployment checks should allow for propagation before reporting a failure.
Understanding it simply
GitHub Pages turns a folder of web files stored on GitHub into a real website that anyone can visit. There is no server to rent, install or update. When the files change, the website changes too.
It is like pinning finished posters to a public notice board: visitors can see them at any time, but the board cannot take orders or answer questions. That makes it ideal for documentation, portfolios and project pages, but not for online shops or interactive applications.
Applied in practice
A small open source team maintains a data validation library and wants documentation that always matches the latest release. They write the guides in Markdown inside a docs folder and add a GitHub Actions workflow that builds the site with MkDocs on every push to the main branch, then deploys it to GitHub Pages.
The team points docs.example.org to the site with a CNAME record, verifies the domain and enables Enforce HTTPS. A typical build finishes in under two minutes, the output is about 40 MB, and monthly traffic stays well below the soft bandwidth limit. The outcome is reliable, versioned documentation at no hosting cost, and contributors can propose documentation fixes through the same pull requests they use for code.