博客同时部署Github和Coding page

前期

注册账号不讲了,现在都是以团队注册。 注册完后,记得到团队设置里面,找到实名认证。(在初次使用静态网站服务前,需要团队拥有者完成实名认证)

在这里插入图片描述
然后需要在个人设置里绑定邮箱和设置密码,顺便把公钥添加下。
在这里插入图片描述

在这里插入图片描述
创建一个项目,然后点进这个项目中,


部署静态网站

在项目设置里吧持续部署开关打开。(这里参考官方文档找了好久找不到,TND官方文档真的Fucx)
在这里插入图片描述
在这里插入图片描述
打开博客源码,在根目录的config.yml文件里的deploy里面,修改为

deploy:
  type: git
  repo:
    github: git@github.com:{username}/{reponame}.git
    coding: git@e.coding.net:{username}/{reponame}.git # 团队版的coding
    coding-personal: git@git.dev.tencent.com:{username}/{reponame}.git # 个人开发版
  branch: master
# 这里错了好多次,有两点:yaml中冒号后一定要加空格、多个仓库一定要改成键值形式,当然前面的名称随便填,能区分就可以

其他

在这里插入图片描述
在这里插入图片描述

收尾

添加新的解析规则后可能引发github DNS解析问题(针对国内IP被墙),导致GitHub Pages HTTPS证书自动签发错误。

通过搜索和查阅文档,可确定其原因与自定义域名的DNS解析记录有关。在这里插入图片描述

HTTPS errors


GitHub Pages sites using custom domains that are correctly configured with CNAME, ALIAS, ANAME, or A DNS records can be accessed over HTTPS. For more information, see “Securing your GitHub Pages site with HTTPS.”


It can take up to an hour for your GitHub Pages site to become available over HTTPS after you add and correctly configure your custom domain. After updating existing DNS settings, you may need to remove and re-add your custom domain to your GitHub account to trigger the process of enabling HTTPS. For more information, see “Using a custom domain with GitHub Pages.”


If you’ve chosen to use Certification Authority Authorization (CAA) records, at least one CAA record must exist with the value letsencrypt.org for your GitHub Pages site to be accessible over
HTTPS. For more information, see “Certificate Authority Authorization (CAA)“ in the Let’s Encrypt documentation.


Custom domains configured with A records


If you configured your custom domain using an A record, your A record must point to one of the following IP addresses for HTTPS to work:

  • 185.199.108.153
    -185.199.109.153
    -185.199.110.153
    -185.199.111.153

After updating any A record IP addresses, you must remove and re-add your custom domain to the repository you’re using to publish your Pages site to trigger the process of enabling HTTPS. For more information, see “Configuring A records with your DNS provider” in “Setting up an apex domain.”

在GitHub提供的针对自定义域名的Trouble Shooting文档中,可以看到,GitHub Pages要求启用HTTPS的自定义域名必须把DNS解析到以下4个IP地址上:

  • 185.199.108.153
  • 185.199.109.153
  • 185.199.110.153
  • 185.199.111.153

而使用CDN时,域名显然时解析到CDN的代理服务器上的。

我们可以通过nslookup命令查询下自己域名的DNS解析:
在这里插入图片描述
DNS解析记录生效后,可以通过以下方法手动更新GitHub Pages的HTTPS证书:

在GitHub Pages站点设置中,删除Custom domain并点击Save以取消自定义域名;重新设置Custom domain并Save以重新启用自定义域名。随后,GitHub Pages会对自定义域名申请新HTTPS证书。几分钟左右重新验证该自定义域名即可正常访问。


吐槽下,coding page更新界面真的官方文档不更新吗?真的吐了!!!

官方笑话:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值