I’m using Docusaurus / Travis CI to build my docs and I’m trying to have them hosted on a custom domain - myproject.com. The way I have it setup right now Travis CI initiates a build every time I do a commit BUT the custom domain gets wiped out every time this happens. I can duplicate the issue by manually initiated builds myself.
It happens regardless of what the repo name is. I’ve tried myproject.github.io as the repo name and myproject.com (to match the custom domain) as the repo name. In both cases the custom domain gets wiped. When the repo name is myproject.github.io the site gets published to https://myproject.github.io/ and when the repo name is myproject.com the site gets published to https://myproject.github.io/myproject.com/ .
Am I just going to have to remember to always re-add the custom domain every time I make a commit to my build branch? 🙄
I figured this out. Farook's post pointed me in the right direction.
So when the branch is named myproject.github.io the master branch is used for deployments. Like myproject.github.io is a mirror of what's in the master branch.
The problem is that the *.md files that you modify to work with Docusaurus aren't the end product so you have to work out of a branch other than master. Within that branch a lot of the root contents are built from the *.md
files but the rest of it is copied from the website/statics
directory so I just put the CNAME
file there and that worked!