Host Exported HTML 5 game prototype on github pages

2
  • 10 favourites

Stats

3,945 visits, 5,604 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

So I was looking for a why to host the exported version of my game prototype/mock, without too much effort if the source was already pushed to git hub. I also wanted some friends to test the prototype; and so html would be ideal for them to access it remotely. Tried Drop box, and Goolge drive, without much success. Also I did not want to host on the Scirra arcade or the like; as this was not a completed game. This was also the case for creating and then hosting it on a site, as this was not a finished product.

Turns out pushing the exported game to git hub pages works fine, and is a nice correlation, between source and the deployed version, with version control then built in to correlate.

NB: Listed this tutorial here as advanced as it requires you to know Github, and does not seem like its mentioned as a method, either here or in the forms, for deployment.

Setting up

So you first need to create a Github account if you don't already have one and use your favorite GUI/command line interface for Github. I would recommend the GUI in any case, as its also easy to launch the command line interface from here.

https://help.github.com/articles/set-up-git/

Next we need to create a repository for the source/original files to be hosted on GitHub.

You can skip this point if you only want to host the exported game.

Create repository for source

Create a repository and do your first commit as mentioned , do not push/publish yet

https://help.github.com/articles/create-a-repo/

and then copy the files to the local location on your computer and make sure the changes are reflected in the GUI when opened, or if you check the git status. Then commit again, with the same process as before.

You can now push/publish the code by pressing the publish button or using "git push" in the command line.

Once this is done, we can export the project.

Export the project as HTML5

Please check the tips mentioned here, as they are very good for knowing what happens game if certain options selected when exporting to HTML 5. https://www.scirra.com/tutorials/655/tips-on-publishing-html5-games-to-the-web

Then remember the location of the exported files (should resemble a HTML 5 website with an index file in the root folder) for the next step.

Setup Github Pages

Follow the instruction set here up until, just before the commit/push/publish section https://pages.github.com/ as we first need to add the exported file form the previous step to our new repositories local folder. Once this is done, you can now commit and push the changes.

If all this has gone well, you should now be able to play/test your game on a site, looking like username.github.io

Hope this helps you to quickly deploy your code, while still having source control in relation to it, and can enable your testers/friends, to test the latest deployed version.

Regards,

W

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!