Lesson 04 · GitHub platform · 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.
| Type | Repo name | URL | Limit |
|---|---|---|---|
| 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/learningThat's a project site — the repo name becomes the path. The index.html already in this repo would become the homepage.
Every Pages site has a source — where GitHub looks for the files to publish. There are exactly two options:
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
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.
The entire setup is four clicks:
main) and folder (/ (root)). Click Save.Within a few minutes, your site is live. A green banner in the Pages settings shows the URL.
/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.
Mental guardrails worth having early:
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.
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.
main, folder / (root). Save.https://stianbranden.github.io/learning.index.html — the course index — live on the internet.main auto-updates the site. Your learning workspace is now a published website.
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.