Notice: this was fun when services like Netlify and Cloudflare Pages didn't exist, and if you wanted to use a framework that's not Jeykll (Github Pages back then only supported building Jeykll sites, there was no Actions). Now days, please don't use this, it just generates such a large amount of data in your git history. Garbage I would even call them. Just use one of these aforementioned things.
Github Pages deploy testing with multi-branches and Webpack