详细内容可参该博客: https://blog.csdn.net/qq_41646249/article/details/111477328
该篇仅记录绑定过程,避免忘记。

1.注册自己的域名

域名可以再阿里云或者腾讯云进行购买。
阿里云域名链接,无需备案。

github pages快速入门

2.在GitHUb上创建一个自己的仓库,添加域名

2.1 创建仓库

创建一个仓库

2.2 添加域名

创建CNAME 文件,文件内容写自己的域名,不包含www.
添加域名

2.3 在Setting中将域名添加到Custom domain中

如果没有直接搜到Custom domain,需要在Pages->Build and deployment->修改为GitHUB Actions
添加域名到Custom domain

3.添加域名解析获取ip地址

ping xxxx.github.io

$ ping xxxx.github.io

Pinging xxxx.github.io [185.xxx.xxx.153] with 32 bytes of data:
Reply from 185.xxx.xxx.153:: bytes=32 time=131ms TTL=50
Reply from 185.xxx.xxx.153: bytes=32 time=135ms TTL=50
Reply from 185.xxx.xxx.153:: bytes=32 time=129ms TTL=50
Reply from 185.xxx.xxx.153:: bytes=32 time=132ms TTL=50

Ping statistics for 185.xxx.xxx.153:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 129ms, Maximum = 135ms, Average = 131ms

4.在阿里云修改域名解析记录

点击添加记录默认添加即可
在这里插入图片描述

5.ping 域名即可成功

succcess

Logo

免费领 150 小时云算力,进群参与显卡、AI PC 幸运抽奖

更多推荐