Deploying a website to an organization or user Github pages

Nick Meiremans
AB-IT
Published in
2 min readMar 5, 2018

Deploying to a organization or userpage on github pages is different than a regular project.

I came across this small issue, I wanted to make a website hosted on Github pages with an url like[organization].github.io instead of [organization].github.io/[project].

Github offers this feature for organizations and user pages but the restriction on these pages are -for reasons beyond my comprehension- only available on the master branch.

While this isn’t a problem with regular HTML pages, I am making a React app and I prefer to keep my master branch for development.

The 2 options I have:
- Develop on a development branch and push to master.
- Develop in a different Repository and copy it into this repository

Clearly I took the hard path and chose for option 2. Because I want to use master for development.

So I made an other repository, made the app, published the live code to a separate branch and created this script to copy it:

Just fill in the url’s in the script and the branch you want to deploy to your main site and you are done :-)

You can now develop as you want in your projects repository and when you feel it’s done, run the script and deploy it to your live site.

--

--