Go Live! Deploy to GitHub Pages

Objective: Go Live! Deploy to GitHub Pages

Welcome to the final step of deploying your Pygame project to the web!

Our objective is to navigate to your repository's settings on GitHub and configure GitHub Pages to deploy from the main branch. We will then wait for the deployment to complete and verify that your Pygame game is live and playable at the provided URL.

Check Spec: Confirm Repository State

Before configuring GitHub Pages, let's quickly confirm the state of your repository.

Ensure that the main branch of your GitHub repository contains the web-ready code, including the web/index.html file and the generated game.js and game.wasm files (or equivalent output from your web export tool).

This setup is necessary for GitHub Pages to correctly serve your game.

Implement: Configure GitHub Pages

Now, let's configure GitHub Pages to deploy your web-exported game.

Step by step checklist:

  1. Navigate to the settings page of your GitHub repository.
  2. Find and select the 'Pages' section in the left-hand navigation menu.
  3. Under 'Build and deployment', ensure 'Deploy from a branch' is selected.
  4. Under 'Branch', select the main branch as the source.
  5. Select the folder that contains your index.html file (likely / or /web).
  6. Click 'Save'.
  7. Wait a few minutes for GitHub Pages to build and deploy your site.

The following documentation sections are going to be helpful:

  • GitHub Pages Deployment

Validate: Check the Live URL

With GitHub Pages configured and the deployment process completed, it's time to validate that your game is live.

Navigate to the URL provided by GitHub Pages (it will be in the format https://yourusername.github.io/your-repo-name/).

Expected Outcome: Your Pygame game should load and be playable directly in your web browser.

Documentation

Documentation not available for PY-1.4-BP6.