How to publish a site with GitHub Pages

Updated · DeskHowTo

On GitHub.com (verified 2026-10-24), open the repository → Settings → Pages → under Build and deployment choose a Source (Deploy from a branch, or GitHub Actions). For branch deploys, select main / docs folder (or root) → Save. Wait for the green check, then open the site URL shown (often https://<user>.github.io/<repo>/).

Public pages are free for public repos within GitHub’s current limits; private-repo Pages availability depends on plan. Do not put secrets in a Pages site — it is public content.

Jump to

Applies to GitHub.com repositories where you have admin access. Organization policies may block Pages. This guide is for legitimate project docs/sites, not phishing or malware hosting.

Enable Pages and verify the URL

Open Pages settings

  1. Repo → Settings.
  2. Click Pages in the left sidebar.
  3. Find Build and deployment.

Choose a source

  1. Select Deploy from a branch (simple) or GitHub Actions (workflows).
  2. For branch deploy: pick branch + / or /docs folder → Save.
  3. Commit an index.html (or Jekyll/docs site) if the folder is empty.

Open the published URL

  1. Wait for the Pages build to finish (Actions tab or Pages status).
  2. Click the visit-site URL GitHub shows.
  3. Fix 404s by confirming the index file path and base URL for project sites.

Our take: /docs on main for small project sites

Keep product code on main and static docs in /docs so Pages cannot confuse app deploy pipelines.

If it fails

  • 404 on project site: asset paths need the repo base path — fix relative URLs.
  • Pages menu missing: no admin rights, or org disabled Pages.
  • Build failed: open Actions for the Pages workflow error log.
  • Custom domain later: add DNS only when you intentionally own that domain — not required for *.github.io.

Frequently asked questions

How do I turn on GitHub Pages?

Repository Settings → Pages → choose a source (branch or Actions) → Save.

Where is my site URL?

GitHub shows it on the Pages settings page after the first successful deploy (user or project URL).

Do I need a custom domain?

No — *.github.io works for getting started; custom domains are optional.

Can private repositories use Pages?

It depends on your GitHub plan and current product limits — check GitHub Docs for private Pages.

Is GitHub Pages the same as a wiki?

No — wikis are repo wiki pages; Pages hosts a full static website from files or a workflow.