# How to publish an AI-generated site on GitHub Pages

> Step-by-step guide to publishing a static site from Claude, Codex, ChatGPT, or another AI tool with GitHub Pages, plus when to use Revdoku instead.

![GitHub Pages service page](/assets/blog/publish-ai-site-github-pages/01-service-page.png)

GitHub Pages publishes a static website directly from a GitHub repository. It works well for public portfolios, documentation, demos, and project pages that do not need a server or database.

## Before you start

Prepare a static website with `index.html` at the publishing root. If your project uses a framework, build it first and decide whether you will commit the output folder or use a GitHub Action.

GitHub Pages sites on free accounts are public. Do not put secrets, private client data, or API keys in the repository.

## 1. Create a GitHub repository

Sign in to GitHub, create a repository, and give it a short name. A project named `portfolio` normally publishes at:

```text
https://YOUR-NAME.github.io/portfolio/
```

A repository named `YOUR-NAME.github.io` publishes at the account root instead.

![GitHub guide to creating a Pages site](/assets/blog/publish-ai-site-github-pages/02-create-site.png)

## 2. Add the website files

Upload the files through GitHub’s web interface or push them with Git. Keep `index.html` in the repository root if you plan to publish from `/(root)`.

Check asset paths. A path beginning with `/` points to the domain root and can break on a project site. Relative paths such as `assets/logo.png` are usually safer.

## 3. Turn on GitHub Pages

Open **Settings**, choose **Pages**, then select **Deploy from a branch** under **Build and deployment**.

Choose:

- Branch: `main`
- Folder: `/(root)` if the site files are at the repository root
- Folder: `/docs` if you placed the site in a `docs` folder

Save the setting. GitHub starts a deployment and shows the public URL when it is ready.

![GitHub Pages publishing source settings](/assets/blog/publish-ai-site-github-pages/03-publishing-source.png)

## 4. Open and test the site

The first deployment may take a few minutes. Open the Pages URL from the repository settings and test:

- Navigation and relative links
- Images, fonts, CSS, and scripts
- Mobile layout
- Direct links to nested HTML pages
- The browser console for missing files

GitHub Pages is static hosting. Login systems, server code, private environment variables, and databases require another service.

## 5. Add a custom domain

In **Settings → Pages**, enter the custom domain and save it. Add the DNS records GitHub shows, then enable **Enforce HTTPS** when it becomes available.

Follow the official [GitHub custom domain guide](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site) and verify the domain before depending on it.

## Update the site

Edit or replace the files and push them to the publishing branch. GitHub Pages redeploys automatically. Check the repository’s Actions tab if an update does not appear.

| Check | Ready when |
|---|---|
| Repository | It contains no secrets or private data |
| Entry file | `index.html` is in the published folder |
| Pages source | The correct branch and folder are selected |
| Public URL | The GitHub Pages address opens |
| HTTPS | The custom domain loads securely |

Your site is live.

Start publishing for free

Connect this AI to Revdoku so it can store files, create, update, and publish websites for me. Read and follow https://revdoku.com/prompt.md. A Revdoku account is required. If I do not have one, send me https://app.revdoku.com/users/sign_up?utm_source=revdoku.com&utm_medium=ai-chat&utm_campaign=connect_ai_first and wait until I confirm signup is complete. For ChatGPT, Claude, or another cloud AI, connect https://app.revdoku.com/mcp and complete Revdoku OAuth. For a local agent, use Revdoku's browser device sign-in and complete the connection in Revdoku. Never ask me for a password or API key in chat, or for a verification code. When Revdoku tools are connected, verify the connection, tell me you’re ready, and ask what I want to publish.

Copy Prompt

or

Create Free Account

---

[View the canonical page](https://revdoku.com/blog/publish-ai-site-github-pages/) · [Browse llms.txt](https://revdoku.com/llms.txt)
