If you absolutely cannot switch from wordpress, but absolutely need to host on github pages, then your only option is probably to look into some wordpress plugin that will take your entire site and spit out a static website (kind of like jekyll, but for wordpress specifically). Also, many WordPress sites are not as fast as they should be because they are dynamically generating content as the user requests it, unless you use a caching plugin, which is effectively saving a "static copy of the site". It allows you to host projects online and use Git's powerful version control to track every change. More importantly, there are many ways in which using version control can help WordPress development.
In this example, we'll use the default Twenty Seventeen theme, which should already be included in your local WordPress installation. The WordPress block editor has multiple embedding tools that make it easy to incorporate external media into your WordPress page or blog post. For users who want to share their photography (or feature the work of other photographers, with permission of course) on their WordPress site, the SmugMug. I'm thinking of transferring my WordPress blog to the Github pages, but I've read many options, such as using Jekyll and Hugo.
However, for this process to work, your wordpress hosting provider must support Secure Shell (SSH) access and the use of Git, which are both key to making the push happen. After that, what you're going to do is create a new WordPress installation on GitHub, clone it locally, and then push that instance to GitHub. In this case, you're going to create a local staging environment by installing WordPress on your computer. Also, knowing how to use GitHub and deploy code from it to your WordPress web host can make the development process much more secure.
So, after some research and trial and error, my preferred WordPress plugin for generating static content is Simply Static. It is one of the most popular platforms for developers to host their projects and collaborate with others.