Github forgets about my custom domain every time I update the website

It resets to the default xxx.github.io URL every time I update the site. I have to input the custom domain on the repository settings every single time I update the website. Any advice?

2 Likes

When you configure the custom domain in the settings, it adds a CNAME file to the pages root. You must be force-pushing when you update your site. If you add a CNAME file containing the custom domain name to your pages root (or pull in the commit GH makes when you set the custom domain in Settings), you shouldn’t have this problem.

9 Likes

@ryanzim wrote:

When you configure the custom domain in the settings, it adds a CNAME file to the pages root. You must be force-pushing when you update your site. If you add a CNAME file containing the custom domain name to your pages root (or pull in the commit GH makes when you set the custom domain in Settings), you shouldn’t have this problem.

@flarsystem It looks like you started a comment here with a quote, but then the rest of your content didn’t come through. Was there more you meant to add here?