Custom domain rollback bug

 I’m trying to serve my project page in github. The repository of project page is https://github.com/boijodoc/boijodoc.github.io. I first connected my custom domain elk.pol4.dev with A record of DNS to this repository and it worked well. But, GitHub Pages warned me to use CNAME record so I changed to it. But after changing to CNAME record everytime I push to repository custom domain setting is gone so I have to reset custom domain. How can I fix this problem? Do I have to use A record for custom domain?

This error was caused by config error. I setup my baseURL to custom domain but it has to be set to github pages domain. I got email from github had error while building but I’d checked my email just now.

Edit. It was not config error. My CNAME record elk.pol4.dev is pointing boijodoc.github.io correctly but when I push github say is not.