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

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

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

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

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