Deployment Guide
This guide explains how to deploy the MkDocs site to GitHub Pages.
Automatic Deployment
The site is configured to automatically deploy to GitHub Pages when you push changes to the main branch.
How It Works
- Push to main branch - When you commit and push changes to the
mainbranch - GitHub Actions triggers - The workflow automatically starts
- Site builds - MkDocs builds the static site
- Deploys to GitHub Pages - The site is automatically published
Workflow File
The deployment workflow is located at .github/workflows/deploy.yml. It:
- Checks out your repository
- Sets up Python
- Installs MkDocs and dependencies
- Builds the site
- Deploys to GitHub Pages
Manual Deployment
You can also trigger deployment manually:
- Go to your repository on GitHub
- Click on the Actions tab
- Select Deploy to GitHub Pages workflow
- Click Run workflow button
- Select the branch (usually
main) - Click Run workflow
GitHub Pages Configuration
Initial Setup
- Go to your repository Settings
- Navigate to Pages in the left sidebar
- Under Source, select GitHub Actions (not "Deploy from a branch")
- Save the settings
Custom Domain
If you're using a custom domain (like web.dataidea.org):
-
Create CNAME file in the
docs/directory:web.dataidea.org -
Update mkdocs.yml - Ensure
site_urlmatches your domain:yaml site_url: https://web.dataidea.org/ -
Configure DNS - Add a CNAME record pointing to your GitHub Pages URL:
- Type:
CNAME - Name:
web(or@for root domain) -
Value:
your-username.github.io(or your repository's GitHub Pages URL) -
Wait for DNS propagation - This can take up to 24 hours
Troubleshooting
Deployment Not Working
- Check Actions tab - Look for any errors in the workflow run
- Verify branch name - Ensure your default branch is
main(or update the workflow file) - Check permissions - Ensure GitHub Actions has write permissions
- Review logs - Check the workflow logs for specific error messages
Site Not Updating
- Wait a few minutes - Deployment can take 1-2 minutes
- Clear browser cache - Hard refresh (Ctrl+F5 or Cmd+Shift+R)
- Check GitHub Pages status - Go to Settings > Pages to see deployment status
Build Errors
Common issues:
- Missing dependencies - Ensure all required packages are in the workflow
- Syntax errors - Check
mkdocs.ymlfor YAML syntax errors - Missing files - Ensure all referenced files exist
Local Testing
Before deploying, always test locally:
# Serve locally
mkdocs serve
# Build and check
mkdocs build
Branch Configuration
If your default branch is not main, update the workflow file:
on:
push:
branches:
- master # Change to your default branch name