gitname / react-gh-pages

Deploying a React App (created using create-react-app) to GitHub Pages
6.55k stars 919 forks source link

Best way to push ongoing changes #178

Open nssensalo opened 8 months ago

nssensalo commented 8 months ago

push #commits

Which of these applies to you? (Select all that apply)

Step

Which step of the tutorial do you want someone to help you with? (Select one)

Links

Tell us where we can find your code and your GitHub Pages site:

Everything else

You can put whatever you want into this section.

My site is up and running. Moving forwards, what is the best way to publish ongoing changes? Do I " npm run deploy" for every update? If so, I see on the github page commits and pull request for the gh-page branch. Do I NEED to address those ? Beacuse there isn't another comperable gh-pages branch to compare and reconcile with. I just leave it?

Thanks

dj-lee1 commented 7 months ago

I have the same question - should I commit to main/master, checkout gh-branch, then deploy? Commit to main and then pull request?

gitname commented 6 months ago

Hi @nssensalo and @dj-lee1, thanks for asking this question. The way I do it is to store my source code on the master or main branch (like with any other repository); and then, separately, whenever I want to update the deployed site, run $ npm run deploy.

gitname commented 6 months ago

At least, that is how I used to do it. Nowadays (on my real, work projects), I use GitHub Actions with something like this to build and deploy the app for me whenever I create a new Release on GitHub.