Search code examples
deploymentmiddlemangithub-pages

How to deploy a Middleman site to GitHub user page


I'm trying to deploy a Middleman project to my GitHub user page ([username].github.io). I'm using the middleman-gh-pages gem, and the instructions seem simple enough.

However, after running bundle exec rake publish, my GitHub user page still shows a 404. I see the build on GH, and it's on the 'gh-pages' branch.

Here is my directory structure on master after publishing.

Here is my directory structure on the gh-pages branch after publishing.

When I navigate to [username].github.io/source/index.html.haml, my browser downloads the haml file. It seems like my gh-pages branch is not what's actually being served up. Has anyone else encountered this problem? How can I make it so the gh-pages branch is what is served when I go to my GitHub user page?


Solution

  • A username.github.io aka a user/organisation site is supposed to be pushed in master branch.

    middleman-gh-pages gem seems to only push in gh-pages (see publish task here) which is the branch for project pages (username.github.io/projectName).