-
Notifications
You must be signed in to change notification settings - Fork 122
Wiki Automation Guide
Dr M H Buddhika Ariyaratne edited this page Aug 7, 2025
·
1 revision
This document explains the automated wiki synchronization system for the HMIS project.
The HMIS project now includes an automated wiki synchronization system that keeps the GitHub wiki in sync with documentation stored in the main repository. This provides a single source of truth for all documentation.
- All wiki documentation is stored in
docs/wiki/directory in the main repository - Files are organized by module (e.g.,
Pharmacy/,LIMS/,OPD/) - Standard markdown format (
.mdfiles) is used
The system provides three ways to sync documentation:
- Triggers automatically when you push changes to
docs/wiki/ordeveloper_docs/ - Works on
developmentandmasterbranches - Can be manually triggered from GitHub Actions tab
- Wiki sync is built into the existing
safe-pushscripts - Automatically syncs when you use
scripts/safe-push.batorscripts/safe-push.sh - Only syncs if
docs/wiki/directory exists
- Windows:
scripts/sync-wiki.bat - Linux/Mac:
scripts/sync-wiki.sh - Can be run manually anytime
docs/
└── wiki/
├── README.md # Main wiki documentation guide
├── Pharmacy-Issue.md # Main pharmacy issue documentation
├── Pharmacy-Issue-Configuration.md # Configuration guide
├── Wiki-Automation-Guide.md # This file
└── Pharmacy/
└── README.md # Pharmacy module overview
- Create your markdown file in the appropriate
docs/wiki/subdirectory - Use kebab-case naming (e.g.,
new-feature-guide.md) - Include proper markdown headers and navigation links
Option A: Use Safe-Push (Recommended)
# Windows
scripts\safe-push.bat
# Linux/Mac
./scripts/safe-push.shOption B: Manual Git Push (Auto-sync via GitHub Actions)
git add docs/wiki/
git commit -m "Add new documentation"
git pushOption C: Manual Sync Script
# Windows
scripts\sync-wiki.bat
# Linux/Mac
./scripts/sync-wiki.sh- Check GitHub Actions tab for sync status
- Visit https://github.com/hmislk/hmis/wiki
- Verify your documentation appears correctly
docs/wiki/
├── Module-Name/
│ ├── README.md # Module overview
│ ├── feature-guide.md # Feature-specific guides
│ └── configuration.md # Configuration instructions
├── images/ # Shared images
└── Module-Main-Page.md # Top-level module page
-
Files: Use kebab-case (e.g.,
pharmacy-issue-configuration.md) -
Images: Descriptive names (e.g.,
pharmacy-issue-interface.png) -
Directories: PascalCase for modules (e.g.,
Pharmacy/,LIMS/)
-
Headers: Use proper markdown hierarchy (
#,##,###) - Links: Use absolute GitHub wiki URLs for cross-references
-
Images: Store in
docs/wiki/images/directory - Code Examples: Use proper code blocks with language specification
- Each module should have a main page (e.g.,
Pharmacy-Issue.md) - Link to sub-pages using full GitHub wiki URLs
- Update parent pages when adding new documentation
1. Sync Not Working
- Check GitHub Actions tab for error details
- Verify
docs/wiki/directory exists - Ensure files are properly committed
2. Missing Links
- Use full GitHub wiki URLs:
https://github.com/hmislk/hmis/wiki/Page-Name - Check file naming matches wiki page names
3. Permission Errors
- Ensure you have write access to the repository
- Check that GitHub token has appropriate permissions
4. Formatting Issues
- Verify markdown syntax is correct
- Use standard GitHub-flavored markdown
- Test locally with markdown preview
# Check sync status
cd wiki
git log --oneline -5
# View pending changes
git status
# Force sync (if needed)
cd ..
scripts/sync-wiki.bat # Windows
# or
./scripts/sync-wiki.sh # Linux/Mac-
File:
.github/workflows/sync-wiki.yml - Triggers: Push to docs/wiki/, manual dispatch
-
Features:
- Automatic navigation updates
- Content validation
- Detailed commit messages
- Error handling and cleanup
- Go to GitHub Actions tab
- Select "Sync Wiki Documentation" workflow
- Click "Run workflow"
- Choose "Force sync all wiki content" if needed
- Files in
developer_docs/automatically sync to wiki - Converted to
Developer-*pages in wiki - Maintains original structure and formatting
- Weekly: Review GitHub Actions logs for any sync failures
- Monthly: Audit wiki content for accuracy and completeness
- Quarterly: Update automation scripts if needed
- Large image files should be optimized before adding
- Avoid frequent small commits to docs/wiki/ (batch changes)
- Use descriptive commit messages for better tracking
- Main repository serves as primary backup
- GitHub wiki repository serves as secondary backup
- GitHub Actions maintain detailed sync logs
- Only repository collaborators can modify documentation
- Wiki sync uses GitHub's built-in authentication
- All changes are tracked via git history
- Automatic link validation during sync
- Markdown format verification
- File size and type restrictions
- Check this guide for common issues
- Review GitHub Actions logs for specific errors
- Contact repository maintainers for advanced issues
- Automation scripts are versioned with the main repository
- GitHub Actions workflow updates deployed automatically
- Breaking changes will be documented in commit messages
Related Documentation:
Last Updated: Auto-generated on each sync