Don’t know if this could help as I’m working with lit-elements instead of react, but
I use this webpack config file https://github.com/scenaristeur/salut/blob/master/webpack.config.js that build all my code in a dist folder as a single file that is been called in my /dist/index.html.
In my repo config, I’ve set my gh-pages to gh-page branch.
On local repo
I 've commented the /dist folder in my .gitignore file.
And initialised gh-page branch
git add dist -f && git commit -m "Initial dist subtree commit"
To develop on local, I use
npm run start
When I want to publish, I run
npm run build that build my src folder to /dist folder.
See my package.json to add that command to yours and check if you have all dependencies.
Then I push master branch as normal.
Then I use this command to push the dist folder to gh-page branch
git subtree push --prefix dist origin gh-pages
Waiting some minutes that GitHub take it in account and the magic appears…
Here is a basic tutoriel of how I build my app & publish on gh-pages https://github.com/scenaristeur/socialid-template/blob/master/README.md but it’s certainly not optimized. I think I’ll encounter an issue on day as gh says they don’t want to build more than 10Mo , but I cross fingers… I’ve sometimes pushed 12Mo…
The + is that when you have a /dist folder you can also compress it and copy it in a folder on any pod using the great @A_A FileManager https://otto-aa.github.io/solid-filemanager/ to upload and uncompress…
Hope this could help