react-wordle icon indicating copy to clipboard operation
react-wordle copied to clipboard

Help! github pages is not working

Open nextdoorginger opened this issue 3 years ago • 2 comments

I made a clone (https://github.com/nextdoorginger/zordle) of this repository for a TV show, and when I run the code in the local server on my computer it all looks great, but when I open it in github pages, I just get sent to the README! How do I get the code to run successfully through github pages?

nextdoorginger avatar Apr 22 '22 21:04 nextdoorginger

there is currently no out-of-the-box way to deploy to GitHub pages.

A manual way to do that is:

  • run locally npm run build
  • manually copy only the needed files in a newly created docs folder
  • manually make sure path for css and js is relative as in static/... and not /static/...
  • activate github pages and make it use the docs folder

for an example of the results of doing the above: https://github.com/par-le/gioco

in principle this actions could be made more automatic by using a script to do all the above (and this issue could stay open to track a possible improvement of adding such a script and instructions on how to deploy to GitHub Pages).

Note that this repo is currently deployed through vercel, which has the additional advantage that any PR to the repo has a preview of the changes automatically deployed (a similar mechanism is available also through netlify, while for GitHub Pages there seem to be generic plans to make this available)

pietroppeter avatar Apr 23 '22 08:04 pietroppeter

I use tanwanimohit/deploy-react-to-ghpages to get this done - this is the result: https://modem7.github.io/react-wordle/

It requires a few extra things to get it working, but otherwise, it's pretty quick and easy.

modem7 avatar May 10 '22 16:05 modem7