Without your writing any webserver code, GitHub can recognize specifically-named repos/branches and will serve a static page (including HTML/CSS/JS and other static files) at a certain GitHub-based URL. This means free hosting for your public demos, and makes it really easy to host a doc/demo site associated with each of your repositories. You can even set it up with a custom domain.
- Accessible at:
yourusername.github.io
- GitHub automatically reserves this URL for every user and organization to use as their User page, although nothing is published there until you publish.
- To deploy a static site to this URL:
- Create a Github repo with the exact name:
yourusername.github.io
- Commit an
index.html
in the root folder to themaster
branch and push. (From the index page you can link to other folders/files as usual) - Visit
yourusername.github.io
- tada!
- Create a Github repo with the exact name:
- Has content from any repo that is owned by you - not only what lives in your User page repo
- Accessible at:
yourusername.github.io/your-other-repo/
- To deploy a static site to this URL:
- Create a branch in your
your-other-repo
repo namedgh-pages
. - Commit an
index.html
in the root folder to thisgh-pages
branch and push. - Visit
yourusername.github.io/your-other-repo/
- Create a branch in your
You can make your GitHub Pages site more powerful/organized by taking advantage of the static site generator (Jekyll) that GitHub will run your page through by default, but it is optional. If you haven't included any Jekyll-specific configuration, it will be served exactly as-is.
https://help.github.com/categories/github-pages-basics/
If you want to start making use of Jekyll to take advantage of some conveniences that would normally be handled by a website backend, I recommend this guide: