On GitHub
Assuming that you already pushed the website to GitHub, go to “Settings”.If you already didn’t so, rename your repository as <mysite>.github.io: this will publish your repository as <mysite>.github.io.
Now scroll down to find the “GitHub Pages” section.
Publish the master branch:
Enabling HTTPS is not mandatory but is strongly suggested.
Specify your custom domain:
This file contains only one text row, specifying the pointing domain:
mysite.com
On DNS management
Before making changes, backup your current DNS configuration.
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
185.199.109.153
185.199.110.153
185.199.111.153
Now on to the CNAME records.
Add a www host, pointing to <mysite>.github.io. (replace <mysite> with the real name of your repository name): don’t forget to add the dot (.) at the end of the hostname!
If everything is ok, you should see a green banner in the Setting section of the published repository.
Please allow some hour to DNS to propagate and enjoy your website!
Bonus track: adding a subdomain
You can publish a subdomain like blog.mysite.com, creating and publishing another repository on GitHub with a CNAME file specifying the subdomain name as its content:
blog.mysite.com
In your DNS management interface, create another CNAME record with “blog” as hostname and pointing again to <mysite>.github.io. (dot included!)
GitHub will take care to publish the correct repository on the corresponding subdomain.
No comments:
Post a Comment