TRAVEL TEFUDA
免费公网部署 Free public launch

Deploy
公网网站
四步走。

Deploy
Public Site
in 4 Steps.

这是一份极简操作图:先让 GitHub 承载代码,再让 Cloudflare Pages 发布网页。如果要使用个人域名,必须先注册域名,再把 DNS 托管到 Cloudflare。

A compact visual playbook: host the files on GitHub, publish them with Cloudflare Pages, then connect a custom domain after the domain is registered and delegated to Cloudflare DNS.

当前可访问 Pages 免费二级域名
个人域名 需先注册购买
DNS 托管 Cloudflare Free 可用
Now live Pages subdomain
Custom domain registration required
DNS hosting Cloudflare Free works

操作路径

Launch Path

  1. 01.准备代码仓库Prepare the repo
  2. 02.连接 Cloudflare PagesConnect Pages
  3. 03.注册域名并托管 DNSRegister domain and DNS
  4. 04.绑定域名并验证 HTTPSAttach domain and verify HTTPS

STEP BY STEP

STEP BY STEP

示意图里的账号、域名和项目名均为 mock 数据。真实操作时把它们替换成你的 GitHub 仓库、Cloudflare 项目和已注册域名。

All account names, domains, and project names below are mock data. Replace them with your GitHub repository, Cloudflare project, and registered domain.

01

把网页放进 GitHub 仓库

Put the site in GitHub

仓库负责保存网页源文件。以后你本地改完旅行手札,只要推送到主分支,Cloudflare Pages 就能自动重新发布。

GitHub stores the site files. After future edits, push to the main branch and Cloudflare Pages can publish the new version automatically.

github.com/your-name/your-site
Repository
your-site
Branch
main
Publish Folder
/html-guide
02

用 Cloudflare Pages 发布

Publish with Cloudflare Pages

在 Cloudflare 里创建 Pages 项目,连接 GitHub 仓库。构建命令可以留空,输出目录填写实际网页目录。

Create a Pages project in Cloudflare and connect the GitHub repo. Leave build command empty for a static folder and set the output directory.

dash.cloudflare.com/pages/new
Project Name
your-project
Production Branch
main
Build Command
-
Output Directory
path/to/html-guide
Save and Deploy
03

注册域名,交给 Cloudflare DNS

Register domain and move DNS

DNS 不用额外购买,Cloudflare Free 可以托管。但个人域名本身必须先注册。注册后在 Cloudflare 添加站点,选择 Free Plan,再把注册商 nameserver 改成 Cloudflare 给出的两条。

Cloudflare DNS is available on the Free plan, but the custom domain itself must be registered first. Add the domain to Cloudflare, choose Free, then replace registrar nameservers with the two Cloudflare nameservers.

registrar.example / nameservers
Domain
example.com
alpha.ns.cloudflare.com
beta.ns.cloudflare.com
Replace Nameservers
04

绑定域名并检查公网访问

Attach domain and verify access

等 Cloudflare Zone 激活后,在 Pages 项目里添加自定义域名。DNS 记录指向 Pages 二级域名,最后确认 HTTPS 和移动端访问都正常。

After the zone becomes active, add the custom domain in the Pages project. Point DNS records to the Pages subdomain, then verify HTTPS and mobile access.

dash.cloudflare.com/dns/example.com
TypeNameTarget
CNAME@your-project.pages.dev
CNAMEwwwyour-project.pages.dev
Pages Custom Domain
example.com
HTTPS Active

验收清单

CHECKLIST

真正上线前只看这四个结果:仓库可更新、Pages 可访问、域名已注册并切到 Cloudflare、HTTPS 正常。

Before calling it live, check four outcomes: repo updates work, Pages loads, the domain is registered and delegated, and HTTPS is active.

01 / Repo

推送到 main 后会触发 Cloudflare Pages 重新部署。

Pushing to main triggers a new Cloudflare Pages deployment.

02 / Pages

先用 Pages 免费二级域名确认公网能打开。

Use the Pages subdomain first to confirm public access.

03 / DNS

如果域名未注册,DNS 记录不会真正生效。

If the domain is not registered, DNS records cannot go live.

04 / HTTPS

nameserver 生效后再开启并检查 HTTPS。

Enable and verify HTTPS after nameservers propagate.