You can serve your project websites for free on GitHub Pages.
Normally, I use gulp to generate a minified and concatenated build inside the build/
directory,
and then use git subtree
to push only the build/
directory to the gh-pages branch (without needing
to push the build to master).
git subtree push --prefix build origin gh-pages
The easiest thing to do is to delete the existing gh-pages
branch and run
the command above again. You can also checkout that branch and pull from master.
Otherwise you can follow these step.
# First remove build from .gitignore
git commit -m "Deploying to gh-pages"
git branch -D gh-pages
git subtree split --prefix build -b gh-pages
git push -f origin gh-pages:gh-pages
# Lastly undo changes to master branch
git reset --hard HEAD~1
When things don't work out as planned, I recommend deleting the existing gh-pages
branch on GitHub, then reclone the repository and re-run the following command.
git subtree push --prefix build origin gh-pages