An example of using Docusync to automatically sync documentation from multiple repositories and deploy to GitHub Pages using GitHub Actions.
This project demonstrates how to set up a complete CI/CD pipeline for:
- Automatically syncing documentation from other GitHub repositories using Docusync
- Automatically building a Docusaurus site
- Automatically deploying to GitHub Pages
- 🔄 Automatic Sync: Documentation is synced from source repositories on a schedule or when changes occur
- 🏗️ Automatic Build: Docusaurus site is automatically built after synchronization
- 🚀 Automatic Deploy: Site is automatically deployed to GitHub Pages
- 📝 Automatic Commits: Documentation changes are automatically committed back to the repository
- ⚙️ SSH-free Setup: Uses GitHub Token instead of SSH keys
- Docusaurus - Static site generator for documentation
- Docusync - CLI tool for syncing documentation
- GitHub Actions - CI/CD pipeline
- pnpm - Package manager
- GitHub Pages - Static site hosting
git clone https://github.com/Roman505050/docusync-cicd-example.git
cd docusync-cicd-examplepnpm installEdit docusync.json to add your repositories:
{
"repositories": [
{
"github_path": "username/repo-name",
"docs_path": "docs",
"display_name": "Repository Name",
"position": 1,
"description": "Description of the repository"
}
],
"paths": {
"temp_dir": ".temp-repos",
"docs_dir": "docs"
}
}- Go to Settings → Pages in your repository
- Under Source, select GitHub Actions
- The workflow will automatically start deploying the site
The workflow uses the built-in GITHUB_TOKEN with contents: write and pages: write permissions. No additional secrets are required for basic setup.
If you need access to private repositories, add a Personal Access Token as a secret:
- Create a PAT with
repopermissions (for private repositories) - Add the secret in the format:
GH_TOKEN_<USERNAME>(e.g.,GH_TOKEN_DUCOSYNC_CI_CD_EXAMPLE) - Uncomment and configure the
envsection insync-docs.yml
Automatically syncs documentation from source repositories:
-
Triggers:
- On schedule (monthly, on the 15th at 02:00)
- On push to
mainwith changes tosync-docs.ymlordocusync.json - Manually via
workflow_dispatch
-
Steps:
- Checkout repository
- Install dependencies (pnpm, Node.js, Python)
- Install Docusync
- Sync documentation
- Check for changes
- Build site
- Commit and push changes (if there are changes)
Automatically deploys the site to GitHub Pages:
-
Triggers:
- On push to
mainwith changes to relevant files - After completion of "Sync Documentation" workflow
- Manually via
workflow_dispatch
- On push to
-
Steps:
- Checkout repository
- Install dependencies
- Build Docusaurus site
- Deploy to GitHub Pages
pnpm startThe site will be available at http://localhost:3000
pnpm buildpnpm serve.
├── .github/
│ └── workflows/
│ ├── sync-docs.yml # Workflow for syncing documentation
│ └── deploy-pages.yml # Workflow for deploying to GitHub Pages
├── docs/ # Synced documentation
├── src/ # Docusaurus components and styles
├── static/ # Static files (images, etc.)
├── docusync.json # Docusync configuration
├── docusaurus.config.ts # Docusaurus configuration
└── package.json # Project dependencies
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please open an issue or pull request to discuss changes.
- Docusync - CLI tool for syncing documentation
- Docusaurus - Docusaurus documentation
- GitHub Actions - GitHub Actions documentation
- GitHub Pages - GitHub Pages documentation