GitHub: GH Pages Not Working | ReactJS

GitHub: GH Pages Not Working | ReactJS
0.0 0

#1

Hello! So I have decided to finally move away from CodePen and build projects with Clould9. I’m slowly getting the hang of it, and I have my random quote machine up and running in my C9 workspace. When I tried to push the changes to GitHub, everything seemed to update, but I can’t get the project to display on GitHub pages. Does anyone know what I am doing wrong? Thanks!

GitHub repo: https://github.com/nikkilr88/react-workshop-starter-repo
C9 Project: https://ide.c9.io/nicolesattler/react-workspace (Was working, just broke it)
GH Pages: https://nikkilr88.github.io/react-workshop-starter-repo/


#2

First of all, in order for your project to have a working website, it need to have a branch called, “gh-pages”. I don’t know why that is, but it is. So, here are the steps:

  1. Create a branch on your project called, “gh-pages”.
  2. Go to Settings
  3. Under “GitHub Pages”, there should be a link for your website.

I hope this helps and that I am not just explaining something that you already know how to do.


#3

Hi! Thanks for the reply! I have a link to my page already (shared above). I think I am not linking the files correctly


#4

Ok, okay. I actually clicked the link, and it’s taking a while to load. That’s why I thought you were having trouble. Then again, my internet is rather slow right now.


#5

No, that’s just the default text.

The React components aren’t showing up at all.


#6

Update:

I’m redoing the project following this guide. Seems to be going well so far.


#7

I actually made my last freecodecamp project using ReactJS and I managed to set up auto deployment to GitHub pages. The catch is that you need to upload already build application to GitHub pages, not your source files. To do so you need a javascript transpiler. Babel, for example.

If you want to have a look how it works, here are my github repos:
Project: https://github.com/zhukovsd/freecodecamp-calculator
Deployed to github pages: https://zhukovsd.github.io/freecodecamp-calculator/

Hope this helps.