GitHub Pages hosts a static site (plain HTML/CSS/JS — the same kind covered in this site's HTML and CSS courses) directly from a repository, free, with a real URL — no separate hosting account needed.
From a repository's Settings → Pages, choose a source — either a specific branch (commonly a dedicated gh-pages branch, or main) and folder, or a GitHub Actions workflow for a build step.
my-portfolio/
├── index.html
├── style.css
└── script.jsPush these files to the branch configured in Pages settings, and the site is live within a minute or two at:
https://username.github.io/my-portfolio/| Site type | Repository name | URL |
|---|---|---|
| User site (one per account) | Must be exactly username.github.io | https://username.github.io/ |
| Project site (unlimited) | Any repository name | https://username.github.io/repository-name/ |
A domain already owned (from the earlier Hosting & Deployment course's DNS lessons) can point at a GitHub Pages site instead of a traditional host — a CNAME file in the repository plus a DNS record at the domain registrar.
# CNAME file, at the root of the repository
www.example.com| Works fine | Doesn't work |
|---|---|
| Plain HTML, CSS, JavaScript | PHP, Python, Node.js, or any server-side code |
| A React/Vue app, built to static files first | A database connection |
| Client-side API calls to another service | Anything needing a real backend running continuously |
The most common real use for a student
Every static project across this site's courses — a portfolio page, a completed CSS/JS project, this course's own example projects — is deployable on GitHub Pages in minutes, and pairs directly with the public-GitHub-profile advice from the Career Skills course.