Assuming you have:
- A website built using
blogdown
and Hugo - Hosted on GitHub pages, a.k.a .github.io
- Built your blogdown website on your local machine
blogdown:::serve_site()
, which is generated within thepublic
folder - Sync'd your local
public
repository to .github.io repository in your github account
You want to deploy your website to Netlify, which supports custom domains with HTTPS:
-
Sign up on Netlify with your GitHub account.
-
Under Deploy settings:
- Repository - Choose .github.io from your GitHub repositories
- Branch - master
- Build command -
- Publish command -
The existing files will be uploaded from .github.io repository to Netlify servers (takes a few minutes). Netlify will generate a site <some-random-name.netlify.com>
-
Change the site name to something meaningful - e.g. .netlify.com
-
Configure domain:
- Add your custom domain name e.g. <www.your-custom-domain.com>
- Login to your DNS Provider and update CNAME and A settings listed here: https://www.netlify.com/docs/custom-domains/#dns-configuration
- Go to the HTTPS tab on Netlify and enable HTTPS
- Let Netlify generate a certificate.
- Check Force TLS to direct all traffic to HTTPS
- Now your website will be active on both GitHub pages and Netlify. When you update .github.io, the changes will be automatically reflected on your website hosted on Netlify.