I own the domain penkov.id.au. I host a blog using github, with an A record for the subdomain michael.penkov.id.au
pointing to the github pages server (204.232.175.
Coincidentally, I ran into a similar issue because I'm using CloudFlare to manage my DNS and GitHub pages on an apex domain. I have two A records pointing to the GitHub Pages servers 192.30.252.153
192.30.252.154
and a CNAME on www subdomain pointing to the root domain.
I asked GitHub support about the random 302 redirects I've been seeing and they told me this:
Because you are using Cloudflare with A records you are running into our Denial of Service (DOS) mitigation technology.
In order to avoid this issue, you could use a sub domain, e.g. blog.example.com, instead of an apex domain, e.g. example.com, as a CNAME for your GitHub Page. This sub domain will be backed by our Content Delivery Network and won't return a 302.
If you would like to use apex domains you will need to point them directly at the GitHub Pages IPs.
Luckily (or not), CloudFlare does offer the chance of breaking the RFC compliance and allow the use of CNAME records on naked domains. Of course it could break the email service, but I'm fine with that because I'm not making use of it.
Hope this helps someone.