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
- Go to GitHub and sign in.
- Click the "+" icon and select "New repository".
- Name it
c-protocol-reference(or your preferred name). - Make it public (required for free GitHub Pages).
- Do not initialize with README (already exists locally).
- Create the repository.
Step 2: Push Local Repository to GitHub
- Add remote:
git remote add origin https://github.com/yourusername/c-protocol-reference.git - Commit changes:
git add . && git commit -m "Initial commit: Add C-Protocol docs and MkDocs setup" - Push:
git push -u origin main
Step 3: Enable GitHub Pages
- In the repository, go to Settings > Pages.
- Under "Source", select "Deploy from a branch".
- Choose branch:
main(ormaster), folder:/docs. - 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
- After push, go to Settings > Pages to get the URL (e.g., https://yourusername.github.io/c-protocol-reference).
- The site should be live within a few minutes.
- 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.