GitHub Pages & Documentation Deployment¶
Branch: gh-docs
Last Updated: December 20, 2025
What is GitHub Pages?¶
GitHub Pages automatically builds and publishes documentation from your repository. When you push to the gh-docs branch, GitHub:
- ✅ Runs MkDocs to build HTML documentation
- ✅ Publishes to
https://YOUR-ORG.github.io/workspace-setup/ - ✅ Updates automatically on every push
Setup GitHub Pages¶
Step 1: Enable GitHub Pages¶
- Go to https://github.com/Golfklubb-IT/workspace-setup-template/settings/pages
- Under Source:
- Branch:
gh-docs - Folder:
/ (root) - Click Save
Step 2: Enable GitHub Actions Workflow¶
The repository includes a GitHub Actions workflow that automatically builds and deploys MkDocs documentation.
File: .github/workflows/deploy-docs.yml
This workflow:
- Runs when you push to gh-docs branch
- Installs Python and MkDocs
- Builds the documentation site
- Publishes to GitHub Pages
Step 3: Verify Deployment¶
After pushing to gh-docs:
- Go to https://github.com/Golfklubb-IT/workspace-setup-template/actions
- Check the latest workflow run
- If ✅ green - documentation is deployed
- If ❌ red - check logs for errors
Building Documentation Locally¶
Install MkDocs¶
# Install Python (if needed)
# Download from: https://www.python.org/downloads/
# Install MkDocs and theme
pip install mkdocs mkdocs-material
# Verify installation
mkdocs --version
Build Locally¶
# Navigate to repository
cd c:\Users\owest\Dev\workspace-setup-template
# Run local server
mkdocs serve
# Opens at: http://localhost:8000
# Automatically rebuilds on file changes
Deploy Manually (if needed)¶
# Build static site
mkdocs build
# This creates `site/` folder with HTML files
# Push to gh-docs branch
git add site/
git commit -m "Docs: Build MkDocs documentation"
git push origin gh-docs
Documentation Structure¶
docs/
├── index.md # Home page
├── DEPLOYMENT_GUIDE.md # Complete setup walkthrough
├── QUICK_START.md # 5-minute quickstart
├── ORGANIZATION_SETUP_GUIDE.md # Step-by-step setup
├── USER_MANAGEMENT.md # Managing users
├── GROUP_MANAGEMENT.md # Managing groups
├── SHARED_DRIVES.md # Shared drive setup
├── SECURITY_SETTINGS.md # Security configuration
├── TROUBLESHOOTING.md # Common issues & solutions
├── GAM_COMMANDS.md # Google Apps Manager reference
├── MIGRATION_PLAYBOOK.md # Migration from legacy systems
├── ONBOARDING_PLAN.md # New employee onboarding
├── TEMPLATE_STRUCTURE.md # Architecture overview
└── PLACEHOLDER_REFERENCE.md # All configuration variables
Customizing Documentation¶
Update MkDocs Config¶
Edit mkdocs.yml to:
- Change site name
- Add/remove pages
- Change theme colors
- Add custom CSS
Add New Pages¶
- Create
.mdfile indocs/folder - Add entry to
nav:section inmkdocs.yml - Push to
gh-docsbranch
Example:
nav:
- Custom Page: custom-page.md
Update Theme¶
Edit mkdocs.yml theme section:
theme:
name: material
palette:
- scheme: default
primary: blue # Change primary color
accent: blue # Change accent color
Branching Strategy¶
| Branch | Purpose | Deploy |
|---|---|---|
main |
Production code | ❌ No |
gh-docs |
Documentation only | ✅ GitHub Pages |
develop |
Development work | ❌ No |
feature/* |
New features | ❌ No |
Common Tasks¶
Update Single Page¶
# Edit documentation
notepad docs/TROUBLESHOOTING.md
# Commit and push
git add docs/TROUBLESHOOTING.md
git commit -m "Docs: Update troubleshooting guide"
git push origin gh-docs
Add New Organization's Documentation¶
When deploying for a new organization:
# Create organization-specific docs folder
mkdir docs/organizations/YOURORG
# Create setup guide
notepad docs/organizations/YOURORG/setup.md
# Add to mkdocs.yml
Search Documentation¶
The Material theme includes built-in search. Users can: 1. Click search icon in top right 2. Type keywords 3. Navigate to relevant pages
Troubleshooting GitHub Pages¶
Workflow Failed¶
Check GitHub Actions logs: 1. Go to Actions tab 2. Click latest workflow run 3. Check "Build documentation" step 4. Fix errors in markdown/YAML
Common errors:
- YAML syntax error - Check mkdocs.yml indentation
- Missing file - File referenced in mkdocs.yml doesn't exist
- Invalid markdown - Check markdown syntax
Site Not Updating¶
# Force rebuild
git commit --allow-empty -m "Trigger docs rebuild"
git push origin gh-docs
Can't Find Deployed Site¶
URL Format: https://GITHUB-USERNAME.github.io/REPO-NAME/
For Golfklubb-IT organization:
- URL: https://golfklubb-it.github.io/workspace-setup-template/
Best Practices¶
✅ DO: - Update docs when code changes - Keep examples current - Use clear headings - Include code blocks with syntax highlighting - Test links locally before pushing
❌ DON'T:
- Commit .env files
- Include sensitive information
- Use very long pages (break into sections)
- Forget to push to gh-docs branch
Resources¶
Last Updated: December 20, 2025