I did something similar for a Jekyll website I was building, but I was using the dev branch to commit the root project, and then, my npm run build or yarn run build would automatically cd to the build folder, check the master branch and commit for me.
npm run build
yarn run build
For the HTTPS problem you're having: you can either use CloudFlare (which will boost your website performance (http2, caching, 100s of PoPs)) or create Let's Encrypt certs which you need to provide your DNS manager (you may not be able to do this).
Yeah I thought about using CloudFlare but only the traffic between the user and CloudFlare is encrypted. Traffic between GitHub and CloudFlare will be plain text. There's probably still an advantage, however I don't like the idea of making the user think their traffic is encrypted end-to-end when it's actually only encrypted half way. If my site transferred any sensitive information, I definitely would have searched for another solution.
Though it might be worth it to look into CloudFlare for the other benefits it can provide!
We’re a place for programmers to stay up-to-date, learn new skills, and share ideas.
We’ll never post without your permission.