How-to guide - static HTML publishing

Publish AI-built HTML pages with GitHub and Cloudflare Pages

Use a coding coworker like Codex or Claude to build static HTML locally, save it into a working directory, push it through GitHub Desktop, and publish it through Cloudflare Pages on a clearly separated subdomain.

What You Are Building

This workflow turns AI-generated HTML into a repeatable publishing loop. The AI helps build and edit. Your local drive keeps the working files. GitHub stores version history. Cloudflare Pages turns the repository into a public site.

1
Part one

Build the HTML with an AI coworker

Start with a small, clear brief. Ask Codex, Claude, or another coding coworker to build one static HTML page at a time. Keep the page self-contained where possible: HTML, CSS, and JavaScript in one file unless there is a good reason to split assets.

  1. Describe the purpose, audience, and tone.
  2. Give the exact folder where the file should be saved.
  3. Ask for a browser check before calling the page finished.
  4. Keep screenshots, PDFs, and images in the same folder or embed them when reliability matters more than file size.
Expected resultYou have a working `.html` file on your local drive that can be opened and tested before it goes public.
Working directoryUse one project folder as the working directory for the site. Keep the HTML files and any image assets together so GitHub and Cloudflare Pages can publish the same structure you tested locally.
2
Local save

Save the file locally before publishing

Local-first matters. It gives you a stable copy before GitHub or Cloudflare are involved, and it gives the AI a real file path it can edit and verify.

  • Use lowercase, hyphenated filenames, such as publish-ai-html-with-github-cloudflare.html.
  • Avoid spaces in final deployment filenames.
  • Keep asset names exact. GitHub and Cloudflare paths can be case-sensitive.
  • Use a standalone HTML version when missing images would break the learning experience.
Common failureA page works locally but deployed images disappear because the PNG files were not committed beside the HTML, or the case of the filename changed.
3
GitHub Desktop

Set up a private GitHub repository

Create or connect a GitHub repository for the working folder. Keep it private while you are building, especially if the folder may contain drafts, screenshots, client names, unfinished prompts, or files that were never meant for public viewing.

  1. Download and sign in to GitHub Desktop.
  2. Add the local working directory to GitHub Desktop.
  3. Publish the repository and keep the code private unless you deliberately want the repository visible.
  4. Each time you build something, save locally, review the GitHub Desktop change list, write a short commit message, and push.
Expected resultGitHub becomes the source that Cloudflare Pages watches. Every push can become a new deployment.
Why Desktop helpsGitHub Desktop gives visual confirmation of changed files, which is useful when an AI tool edits several files at once.
4
Cloudflare Pages

Connect GitHub to Cloudflare Pages

Cloudflare Pages can deploy a static HTML site directly from a GitHub repository. For plain HTML, there may be no build step: Cloudflare can publish the files as they are.

  1. Create or log in to a Cloudflare account.
  2. Add your domain to Cloudflare if you want to use your own domain or subdomain.
  3. Create a Pages project and connect it to the GitHub repository.
  4. Set the production branch, commonly main.
  5. For plain static HTML, leave the build command blank unless your project actually needs one.
  6. Deploy, then open the generated Cloudflare Pages URL.
Expected resultYour local HTML file becomes a public URL after the GitHub push and Cloudflare deployment finish.
Useful behaviourCloudflare's GitHub integration automatically deploys when you push changes to the connected branch.
5
Publishing loop

Repeat the save, commit, push, deploy cycle

Once the pipeline exists, the rhythm is simple:

  1. Build or edit the page with your AI coworker.
  2. Save the file into the working directory.
  3. Open it locally and check the page.
  4. Commit and push with GitHub Desktop.
  5. Wait for Cloudflare Pages to deploy.
  6. Open the live URL and test the public version.
Do not skip the live checkLocal files can hide issues with relative paths, YouTube embeds, image case sensitivity, and external links. Always test the deployed URL.
6
Static security

Use a subdomain and keep public pages low-risk

Static HTML is a great match for AI-generated explainers because there is no server-side application code, no database, and no login system to maintain. But publishing AI-generated pages still opens a public surface, so treat the workflow with care.

Use a subdomain

Publish to something like labs.example.com instead of the main marketing or business domain.

Keep secrets out

Never put API keys, learner details, private links, or drafts in public HTML or JavaScript.

Prefer static files

Plain HTML, CSS, and client-side JavaScript are easier to review than a dynamic backend.

Why a subdomain is sensibleA subdomain gives you a clean boundary. You can publish experimental explainers and AI-built pages without mixing them into the core domain, and you can later add redirects, access controls, caching rules, or takedowns without disturbing the main site.
Public means publicA private GitHub repository does not make the deployed Cloudflare Pages site private. If Cloudflare serves it publicly, assume anyone with the URL can view it.

Two Quick-Share Alternatives

GitHub plus Cloudflare Pages is one repeatable pipeline. For quick prototypes or temporary sharing, here.now and Handoff may be a better fit. Choose the path that matches the audience, privacy need, and life span of the page.

Cloudflare Pages

Use when you want a durable public site connected to a repository, custom domain, and repeat deployments.

here.now

Use when you want fast agent publishing of static sites or files, with anonymous temporary publishing or authenticated permanent sites.

Handoff

Use when you want to share HTML, Markdown, and image outputs with a link and versioned updates.

References and Starting Points