Steps:

1, Add "CNAME" file to github page, the content is your domain. Later in your settings, you can confirm it.

Custom Domain

2, The following operation are all in cloudflare: add your domain to cloudflare, in DNS settings, add CNAME:

Cloudflare DNS

3, Go to "Crypto" settings, change SSL to "full".

Cloudflare SSL

4, In "Page rules" settings, add forward rule, so when user visit every page w/o https, will be redirect to https page.

Cloudflare Forward

Wait for a while, you should visit your custom domain via https, which points to your github page.