Build a Portfolio Website Publishing to GitHub Pages
15 / 16
Next
Publishing to GitHub Pages ~30min

Going Live — Free Hosting with GitHub Pages

GitHub Pages lets you host a static website for free directly from a GitHub repository. Your portfolio will be live at yourusername.github.io/portfolio within minutes.

Step 1 — Create a Repository

Go to GitHub, click New repository, name it portfolio, and set it to Public.

Step 2 — Push Your Files

git init
git add .
git commit -m "Initial portfolio"
git branch -M main
git remote add origin https://github.com/USERNAME/portfolio.git
git push -u origin main

Step 3 — Enable GitHub Pages

In the repo, go to Settings → Pages. Under Source, select main branch and click Save. Your site is live in ~60 seconds.

Custom Domain (Optional)

If you own a domain, add a CNAME file to the repo root containing your domain name, then point your DNS to GitHub Pages IPs.

Checklist Before Publishing

  • All image paths use lowercase filenames (Linux servers are case-sensitive)
  • No broken links — test every <a> tag
  • HTML passes the W3C validator
  • Page loads fast — compress images below 200KB
Tasks
Preview