Skip to content

GitHub Pages Setup for C-Protocol Wiki

This guide explains how to set up GitHub Pages for the static wiki generated by MkDocs. The site will be deployed from the /docs folder or the gh-pages branch, with auto-deploy on push using GitHub Actions for minimal footprint.

Step 1: Create Repository on GitHub

  1. Go to GitHub and sign in.
  2. Click the "+" icon and select "New repository".
  3. Name it c-protocol-reference (or your preferred name).
  4. Make it public (required for free GitHub Pages).
  5. Do not initialize with README (already exists locally).
  6. Create the repository.

Step 2: Push Local Repository to GitHub

  1. Add remote: git remote add origin https://github.com/yourusername/c-protocol-reference.git
  2. Commit changes: git add . && git commit -m "Initial commit: Add C-Protocol docs and MkDocs setup"
  3. Push: git push -u origin main

Step 3: Enable GitHub Pages

  1. In the repository, go to Settings > Pages.
  2. Under "Source", select "Deploy from a branch".
  3. Choose branch: main (or master), folder: /docs.
  4. Save. GitHub Pages will build and deploy from /docs (MkDocs site files will be in /site, but we'll automate copying to /docs for direct serving, or use gh-pages branch).

Alternative: Use gh-pages branch for deployment (via Actions workflow).

Step 4: Configure Auto-Deploy with GitHub Actions

Create .github/workflows/deploy.yml (see next step for workflow file). This builds MkDocs and deploys to gh-pages branch on push to main, ensuring static publishing with minimal footprint.

Step 5: Verify Deployment

  1. After push, go to Settings > Pages to get the URL (e.g., https://yourusername.github.io/c-protocol-reference).
  2. The site should be live within a few minutes.
  3. Updates on push will auto-deploy via Actions.

Troubleshooting

  • If using /docs source, ensure /docs contains the built site (workflow can copy /site to /docs).
  • For custom domain, configure in Pages settings.
  • Check Actions tab for build logs.