Lesson 35 +15 XP

GitHub Pages

GitHub Pages

GitHub Pages is a free service that turns a GitHub repository into a live website.

What can you publish?

  • Personal or project websites.
  • Static HTML, CSS, and JavaScript pages.
  • Documentation for your projects.

How it works

You push your website files to a branch, and GitHub builds and hosts them at a public URL like:

https://username.github.io/repo-name/

Publish a site

  1. Push a project with an index.html to GitHub.
  2. Go to the repository Settings.
  3. Find Pages in the sidebar.
  4. Choose the branch to publish (often main).
  5. Save. GitHub gives you the site's URL.

The special repo name

If your repository is named exactly username.github.io, the site appears at https://username.github.io/ with no extra path.

A great learning tool

GitHub Pages is a perfect way to host a portfolio or practice project for free, no server needed.

TL;DR

  • GitHub Pages hosts static websites from a repository.
  • Publish from the repository Settings > Pages.
  • Sites live at username.github.io URLs.
  • Great for portfolios, docs, and practice projects.