DNS Records for GitHub Pages

Every once in a while I need to modify my custom domain’s DNS records to work with GitHub pages, and every time it’s a struggle to get it right. Here I document my currently-working setup.

I followed the recommended setup1 by configuring www as my Custom Domain, also configuring my apex domain, and letting GitHub Pages “automatically create redirects between the domains”. Specifically for this website, I told GitHub that my Custom Domain is www.