Documentation Deployment
The documentation workflow (documentation.yaml) handles building and deploying project documentation using dual trigger mechanisms to ensure reliable deployment after releases. This system solves critical GitHub Actions limitations for automated documentation updates during releases.
Overviewโ
The documentation deployment system features:
- Dual Trigger Architecture: Handles both direct documentation changes and release-triggered updates
- Workflow Run Pattern: Solves GitHub Actions
GITHUB_TOKENcommit limitation - Intelligent Guard Jobs: Conditional deployment based on actual documentation changes
- Artifact-Based Communication: Reliable cross-workflow communication via artifacts
- GitHub Pages Integration: Automated deployment to GitHub Pages with Docusaurus
Advanced Trigger Architectureโ
The documentation workflow uses a sophisticated dual-trigger system to solve the GitHub Actions limitation where GITHUB_TOKEN commits don't trigger other workflows:
1. Direct Push Trigger (Traditional)โ
on:
push:
branches: ["master"]
paths:
- "docs/**"
- "*.md"
- "README*.md"
- ".github/workflows/documentation.yaml"
- ".github/workflows/release.yml"
- ".github/workflows/release-*.yml"
- ".github/workflows/rw_*.yaml"
- ".github/tag_and_release/**"
Purpose: Handles direct documentation changes pushed to master branch
Triggers On:
- Documentation file changes
- Workflow file changes that affect release processes
- Configuration changes that impact documentation
2. Workflow Run Trigger (Release Integration)โ
on:
workflow_run:
workflows: ["release"]
types: [completed]
branches: ["master"]
Purpose: Automatically triggers after release workflow completion to handle documentation updates made during version bumps
Workflow Run Pattern Implementationโ
Problem Solvedโ
GitHub Actions Limitation: GitHub Actions doesn't trigger workflows on commits made by GITHUB_TOKEN (used in release workflows) to prevent infinite loops. This caused documentation workflow to never trigger after release workflow commits that updated documentation files.
Critical Bug Fixed: The original implementation had a dependency issue where the check_docs_changes job only ran for workflow_run events, but the deployment job depended on it for all events. This caused push events to never deploy because GitHub Actions skips dependent jobs when their dependencies are skipped.
Impact:
- Documentation would become stale after releases because version references in docs weren't being deployed
- Direct documentation pushes were completely broken - they would never trigger deployment due to the skipped dependency
Solution Architectureโ
Guard Job Implementationโ
The documentation workflow includes an intelligent guard job that provides conditional deployment logic: