Host with GitHub Pages
You can deploy your game as a website using GitHub Pages. GitHub Pages allows you to host your HTML, CSS, and JavaScript files for free. Also, GitHub actions enable you to automatically update your game whenever you push changes to your GitHub repo.
Here's a step-by-step guide for how to set up deployment to GitHub Pages with automatic deployment using GitHub Actions.
Steps
Step 1: Setup GitHub Actions
Create a file with the following contents in your repository with the path .github/workflows/deploy.yaml
Step 2: Enable GitHub Pages
Before pushing your changes, you need to enable GitHub pages. On your repository in GitHub, go to settings, pages, and select GitHub Actions as a source under Build and deployment.
Step 3: Push your code
Next time you now push any commit in the branch called main
, the GitHub Action will run, build your project and deploy to GitHub Pages.
Step 4: Setup a domain
While not necessary, you can setup a custom domain name for your game. You can read more about this at this link.
Last updated