Documentation Deployment
The Trajectory documentation is automatically deployed to GitHub Pages using GitHub Actions. This guide covers setup and troubleshooting.
Live Site
- URL: https://dodgerbluee.github.io/trajectory/
- Branch:
gh-pages(automatically managed) - Updated: On every push to
main(when documentation changes)
Automatic Deployment (GitHub Actions)
How It Works
- Trigger: Push changes to
mainbranch indocumentation/folder - Build: GitHub Actions runs the build process (Node.js 20)
- Deploy: Built site is automatically pushed to
gh-pagesbranch - Publish: GitHub Pages serves from
gh-pagesbranch
Workflow File
Location: .github/workflows/deploy-docs.yml
The workflow:
- Triggers on pushes to
mainwhen documentation files change - Installs dependencies (
npm ci) - Builds the site (
npm run build) - Uploads to GitHub Pages artifact
- Deploys using GitHub Pages action
Monitoring Deployments
- Go to Actions tab on GitHub
- Look for "Deploy Documentation" workflow
- Each push shows a run with status (✓ passed or ✗ failed)
- Click run to see detailed logs
Manual Deployment
Prerequisites
# Verify Node.js version (need 20+)
node --version
# Verify git is configured
git config user.name
git config user.email
Steps
# Navigate to documentation folder
cd documentation
# Install dependencies
npm install
# Build the site
npm run build
# Deploy to gh-pages branch
npm run deploy
Local Testing Before Deployment
# Build and serve locally to test
cd documentation
npm run build
npm run serve
# Visit http://localhost:3000/trajectory/
GitHub Pages Configuration
Current Settings
In docusaurus.config.ts:
url: 'https://dodgerbluee.github.io',
baseUrl: '/trajectory/',
organizationName: 'dodgerbluee',
projectName: 'trajectory',
deploymentBranch: 'gh-pages',
trailingSlash: false,
Repository Settings
To verify GitHub Pages is configured:
- Go to Settings → Pages
- Source: Should be "Deploy from a branch"
- Branch: Should be
gh-pageswith/ (root)folder - Custom domain: (optional, leave blank for GitHub-hosted domain)
Troubleshooting
Deployment Workflow Fails
Check the logs:
- Go to Actions → Deploy Documentation
- Click the failed run
- Expand job details to see error
Common issues:
- Dependency cache error: Delete
.github/workflows/deploy-docs.ymlcache in Actions settings - Node version: Verify Node 20+ is used (check workflow file)
- Broken links: Build may fail with
onBrokenLinks: 'throw'- fix links in markdown
Site Not Updating
- Check GitHub Actions workflow ran successfully
- Verify
gh-pagesbranch exists and has recent commits - Clear browser cache and hard refresh (Cmd+Shift+R on Mac, Ctrl+Shift+R on Windows)
- Wait 1-2 minutes for GitHub Pages to rebuild
404 on Live Site
Check:
- Path includes
/trajectory/(e.g.,https://dodgerbluee.github.io/trajectory/docs) - File was built correctly:
npm run build && ls build/ - No typos in
baseUrlindocusaurus.config.ts
Missing Assets (CSS/JS)
Cause: Incorrect baseUrl causes asset paths to be wrong
Fix:
- Verify
baseUrl: '/trajectory/'indocusaurus.config.ts - Rebuild:
npm run build - Test locally:
npm run serve
Documentation Build Process
Build Command
npm run build
Generates:
build/directory with static HTML/CSS/JS- Includes
.nojekyllfile (tells GitHub Pages to skip Jekyll) - Ready for deployment to any static host
What Gets Built
- All markdown files in
docs/→.htmlpages - Blog posts in
blog/→blog/pages - Static assets in
static/→ copied tobuild/ - Images, stylesheets, JavaScript bundles
Build Warnings
The build may show warnings like:
- Unresolved markdown links: Referenced files don't exist (non-breaking)
- Missing tags: Blog tags not in
tags.yml(non-breaking) - Untruncated blog posts: No
<!-- truncate -->marker (non-breaking)
These warnings don't prevent deployment.
Performance
- Build time: ~30-40 seconds on GitHub Actions
- Deployment time: ~1-2 minutes total
- Site size: ~50MB (includes all assets, history)
- CDN: GitHub Pages uses Fastly CDN (fast worldwide delivery)
Rollback
To revert to previous documentation version:
- Identify the commit hash:
git log --oneline -- documentation/ - Force push that commit's build:
git checkout <commit> -- documentation/ - Commit and push:
git commit -am "Revert documentation" && git push - Workflow will rebuild with old version
Or manually push old version to gh-pages:
# From local gh-pages branch with old build
git push origin gh-pages --force
Additional Resources
Support
For issues or questions:
- Check workflow logs in Actions tab
- Test build locally:
npm run build - Review error messages in
buildoutput - Check Docusaurus documentation for configuration issues