Lesson 04 · GitHub platform · pages

Pages

Free static-site hosting baked into every repo. Push HTML, get a live URL — no server, no deploy script, no hosting bill.

You've tracked work with issues, automated checks with Actions, and organised it all with Projects. Now the output: GitHub Pages takes static files (HTML, CSS, JS) from a repo and publishes them as a real website. No server-side code runs — it's just your files, served globally, for free.

Two kinds of site

TypeRepo nameURLLimit
User / org site <username>.github.io https://<username>.github.io One per account
Project site Any repo name https://<username>.github.io/<repo> Unlimited

For this repo, if you enable Pages, the URL would be:

https://stianbranden.github.io/learning

That's a project site — the repo name becomes the path. The index.html already in this repo would become the homepage.

Two publishing sources

Every Pages site has a source — where GitHub looks for the files to publish. There are exactly two options:

Deploy from a branch

Pick a branch (main, gh-pages, any) and a folder (/ root or /docs). Every push to that branch rebuilds the site from those files — no build step, just serve what's there.

Use when: plain HTML/CSS/JS, no build needed

GitHub Actions

A workflow builds the site (using any tool — Vite, Hugo, Jekyll, anything) then deploys the output with actions/deploy-pages. More setup, total control.

Use when: site needs a build step (framework, generator)

For plain HTML like this learning workspace, deploy from a branch is the right choice — zero config, just push and it's live.

Setting it up (branch deploy)

The entire setup is four clicks:

  1. Go to your repo on GitHub → Settings (top nav).
  2. In the left sidebar, click Pages.
  3. Under "Build and deployment" → Source, select Deploy from a branch.
  4. Choose the branch (main) and folder (/ (root)). Click Save.

Within a few minutes, your site is live. A green banner in the Pages settings shows the URL.

The /docs folder option If you don't want your site files cluttering the repo root, put them in a /docs folder and select that as the source. This is common for project documentation that lives alongside source code. It only works with branch deploy — Actions workflows build from wherever your workflow tells them to.

What Pages is not

Mental guardrails worth having early:

Jekyll — the built-in option you can ignore Pages has a built-in static site generator called Jekyll. If your repo contains Markdown files and no index.html, Pages will try to process them through Jekyll automatically. For this workspace we already have HTML files, so Jekyll does nothing — it passes them through untouched. Worth knowing it exists, not worth learning right now.

How this connects

Pages closes a loop with what you already know:

For this repo specifically: the course you're reading right now — these HTML lesson files — could be a live website in under a minute by enabling Pages on main.

Your win — publish this repo as a live site
  1. Go to Settings → Pages on this repo.
  2. Set Source to Deploy from a branch, branch main, folder / (root). Save.
  3. Wait 1–2 minutes, then visit https://stianbranden.github.io/learning.
  4. You should see the root index.html — the course index — live on the internet.
  5. Click through to a lesson and confirm it works.
That's it. Every future push to main auto-updates the site. Your learning workspace is now a published website.

Go deeper

Primary source — read this one: GitHub Docs — About GitHub Pages. Covers site types, limits, Jekyll, and custom domains.

Then configure it: GitHub Docs — Configuring a publishing source. Step-by-step for both branch deploy and Actions deploy.