Github PageでGithub Actionsを利用したビルド・デプロイ時にうまく自前のドメインを反映できない問題 #


事象 #

具体的に↓のようになる。
github pagesの設置欄のCustom domain 項目を修正。

  1. [$username].github.io → xxx.com等に変更
  2. Github Actions を利用しbuild, deployしたら、もとの[$username].github.ioに戻ってしまう。

解決手法 #

hugoのディレクトリ内に、static/CNAMEファイルを作成する必要がある模様。


参考 #

https://gohugo.io/hosting-and-deployment/hosting-on-github/#use-a-custom-domain