1

I'm fairly new to the React ecosystem; I've made a simple single page webpage for a tech conference and I want to deploy it to gh-pages.

I know create-react-app has very good documentation on deploying to gh-pages but my app was not made with that. I manually setup all the configurations for Webpack and React, instead of using the react-scripts module that create-react-app uses.

I tried finding some posts about deploying a non-create-react-app to gh-pages but I've had no luck so I was wondering if there's any simple solutions.

My current solution is to just push only the dist folder to the gh-pages and serve that. I wanted to see if there's a simpler way where I can just push the whole dev branch over to gh-pages and be able to serve the correct elements still.

2 Answers 2

3

You can push the whole dev branch and select github to display the page from master branch. Make sure that in master branch the scripts are compiled into / (index) of the repository, so your page shows up.

Sign up to request clarification or add additional context in comments.

3 Comments

Are you saying to avoid compiling it into a dist/ folder and just compiling everything to the root dir?
That's exactly what Im saying
I'm currently having this same issue and I know this was a while ago, but how would I do this, pushing the whole dev branch and making sure the scripts are compiled correctly
0

I know it's late on this question, but you can use gulp with gulp-gh-pages to automate pushing a React build to Github Pages.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.