This repository contains the files and workflow needed to create a Docusaurus website for the Ampersand documentation.
- Deployment Architecture
- Local Development & Testing
- Production Deployment
- Development Workflow
- Troubleshooting
The Documentation is updated through the following automated workflows:
- AmpersandTarski.github.io contains
DeployToPages.yml, a GitHub Action which retrieves the "docs" folders from Ampersand and Prototype and deploys the Docusaurus Website to GitHub Pages. - Ampersand contains
triggerDocsUpdate.yml, a GitHub Action which triggersDeployToPages.ymlon a push to the development (main) branch when changes are made to the "docs" folder. - Prototype contains
triggerDocsUpdate.yml, a GitHub Action which triggersDeployToPages.ymlon a push to the development (main) branch when changes are made to the "docs" folder.
A GitHub Action can be called from an Action in a different Repository when the target Action contains:
on:
workflow_dispatch:The workflow can then be triggered by a different workflow with the following code:
# Workflow which triggers the workflow in AmpersandTarski.github.io on changes to "Docs"
name: Trigger Documentation Update
on:
# Runs on pushes targeting the development branch which contain changes in the "Docs" folder
push:
branches:
- development
paths:
- 'docs/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Trigger the "DeployToPages" workflow in the "AmpersandTarski.github.io" repository
- run: |
curl -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" \
-H "Accept: application/vnd.github.everest-preview+json" -H \
"Content-Type: application/json" https://api.github.com/repos/AmpersandTarski/AmpersandTarski.github.io/actions/workflows/DeployToPages.yml/dispatches \
--data '{"ref": "main"}'This guide explains how to test the Ampersand documentation locally using Docker, including your prototype framework documentation changes.
- Docker Desktop installed and running
- Access to the following repositories:
/Users/sjo00577/git/AmpersandTarski.github.io(this repository)/Users/sjo00577/git/Ampersand(Ampersand core documentation)/Users/sjo00577/git/PrototypeFramework(Prototype framework documentation)/Users/sjo00577/git/RAP(RAP documentation)
Navigate to the documentation repository and copy all source documentation:
cd /Users/sjo00577/git/AmpersandTarski.github.io
# Clean and recreate tmp directory
rm -rf tmp && mkdir -p tmp
# Copy documentation from all source repositories
cp -R /Users/sjo00577/git/Ampersand/docs tmp/ampersand
cp -R /Users/sjo00577/git/PrototypeFramework/docs tmp/prototype
cp -R /Users/sjo00577/git/RAP/docs tmp/rapBuild and start the documentation site:
docker compose up -d --buildNote: The initial build takes ~4-5 minutes as it installs Node.js dependencies and compiles all documentation.
Open your browser and navigate to:
- Main site: http://localhost:8081
Your prototype framework documentation should appear under:
- Guides section: "Creating Custom BOX Templates" and "Documenting Prototype Changes"
- Reference section: "BOX Template Architecture"
When finished testing:
docker compose down- Make changes to files in
/Users/sjo00577/git/PrototypeFramework/docs/ - Update
sidebar.jsif adding new documents - Follow the Quick Start Instructions above to test locally
- Verify your changes appear correctly at http://localhost:8081
If you're making frequent changes and want faster testing:
- Keep the container running
- Make changes to source documentation
- Rebuild only when needed:
# Copy updated docs cp -R /Users/sjo00577/git/PrototypeFramework/docs tmp/prototype # Rebuild and restart docker compose up -d --build
The local deployment tests:
- ✅ Complete Docusaurus build process
- ✅ All documentation sources (Ampersand, Prototype, RAP)
- ✅ Navigation structure and sidebar configuration
- ✅ Search functionality (Algolia)
- ✅ Responsive design and styling
- ✅ Internal links and cross-references
- ✅ Math equation rendering (KaTeX)
/Users/sjo00577/git/AmpersandTarski.github.io/
├── docker-compose.yml # Docker configuration
├── Dockerfile.localtest # Local testing Dockerfile
├── ampersand-docs/ # Docusaurus configuration
│ ├── package.json # Dependencies
│ ├── docusaurus.config.js # Site configuration
│ └── sidebars.js # Navigation configuration
└── tmp/ # Copied documentation sources
├── ampersand/ # From Ampersand repository
├── prototype/ # From PrototypeFramework repository
└── rap/ # From RAP repository
Your local deployment is working correctly when:
- ✅ http://localhost:8081 loads successfully
- ✅ Navigation shows "Guides" and "Reference materials" sections
- ✅ "Creating Custom BOX Templates" appears under Guides
- ✅ "BOX Template Architecture" appears under Reference materials
- ✅ Search functionality works
- ✅ All internal links function properly
The production deployment to https://ampersandtarski.github.io/ is fully automated through GitHub Actions:
-
Build Process:
- GitHub Actions workflow (
DeployToPages.yml) triggers on pushes to main branch - Docker builds the documentation using
Dockerfile - Static content is extracted from the Docker container
- Artifact is uploaded to GitHub Pages
- GitHub Actions workflow (
-
Cross-Repository Integration:
- Changes to documentation in Ampersand or Prototype repositories automatically trigger deployment
- Uses Personal Access Token (PAT) authentication for cross-repository workflow dispatch
-
Deployment Timeline:
- Build process: ~4-5 minutes
- GitHub Pages deployment: ~2-3 minutes
- Total deployment time: ~5-10 minutes
To manually trigger a deployment:
-
Via GitHub Actions UI:
- Go to Actions tab
- Select "Deploy to Github pages" workflow
- Click "Run workflow" button
-
Via Git Push:
# Make any change to trigger deployment git commit --allow-empty -m "Trigger deployment" git push origin main
-
Make Changes:
- Edit documentation files in the source repositories (Ampersand, PrototypeFramework, RAP)
- Update
sidebar.jsif adding new documents
-
Local Testing:
- Follow the Local Development & Testing instructions
- Verify changes render correctly at http://localhost:8081
-
Deploy to Production:
- Commit and push changes to the main/development branch of the source repository
- GitHub Actions will automatically update https://ampersandtarski.github.io/
- Verify deployment on the live site within 5-10 minutes
-
Monitor Deployments:
- Check GitHub Actions for build status
- Monitor GitHub Pages settings for deployment status
-
Troubleshoot Issues:
- Review build logs in GitHub Actions
- Test locally using Docker setup
- Check for broken links or missing files
If you encounter port conflicts:
-
Check what's using the port:
lsof -i :8081
-
Modify
docker-compose.ymlto use a different port:ports: - 8082:80 # Change 8081 to 8082 or another available port
If the build fails:
-
Clean Docker cache:
docker system prune -f
-
Rebuild without cache:
docker compose build --no-cache docker compose up -d
If your documentation doesn't appear:
-
Verify files were copied correctly:
ls -la tmp/prototype/guides/ # Should show: creating-custom-box-templates.md, documenting-prototype-changes.md -
Check sidebar configuration:
cat tmp/prototype/sidebar.js # Should include your new guides in prototypeGuideSidebar
-
Check Build Logs:
- Go to Actions tab
- Click on the failed workflow run
- Review error messages in the build logs
-
Common Issues:
- Missing documentation files in source repositories
- Broken markdown links or syntax errors
- Docker build failures due to missing dependencies
- GitHub Pages deployment quota exceeded
- Clear Browser Cache: Force refresh with Ctrl+F5 (or Cmd+Shift+R on Mac)
- Check GitHub Pages Status: Visit GitHub Status for platform issues
- Verify Deployment: Check the deployments page
- Check existing issues: GitHub Issues
- Create new issue: Provide build logs and error messages
- Test locally first: Always verify your changes work in local environment before reporting production issues
- Base Image: nginx:stable-alpine
- Build Process: Two-stage (Node.js build → Nginx serve)
- Port Mapping: External 8081 → Internal 80
- Build Time: ~4-5 minutes (first build)
- Rebuild Time: ~2-3 minutes (subsequent builds)
- The local environment exactly matches the production build process
- All documentation changes should be tested locally before pushing
- The Docker approach ensures consistent builds across different development environments
- Port 8081 is used to avoid conflicts with other local services (port 80 often used by other containers)
- Important: Local testing instructions are kept in sync with production deployment processes