📝 Publish Docs
Overview
This GitHub Action automates the process of publishing documentation using MkDocs whenever changes are pushed to the main branch. It ensures that the latest documentation is deployed automatically.
How It Works
The workflow is triggered when changes are made to:
- The docs/directory.
- The mkdocs.ymlconfiguration file.
Workflow Configuration
Trigger
- Triggered by:- A push event to the mainbranch that modifies documentation files.
 
- A push event to the 
Jobs
1. Publish Docs
This job builds and deploys the documentation using MkDocs.
- Runs on: ubuntu-24.04
- Permissions: contents: write
- Steps:- Checkout the repository (with full history for proper deployment tracking).
- Install dependencies from requirements/requirements.docs.txt
- Publish the documentation using mkdocs gh-deploy --force
 
Usage
This workflow runs automatically when changes are pushed to the main branch. However, you can manually deploy the documentation by running the following command locally:
Environment Variables
- GITHUB_TOKEN: Used for authentication and deploying the documentation.
Scripts Used
- mkdocs.yml: Configuration file for MkDocs.
- Files in docs/: Documentation content.
Notes
- Ensure that mkdocsand required dependencies are correctly installed inrequirements.docs.txt.
- The workflow ensures that documentation updates occur only when relevant files are modified.
- The changes are committed and published automatically to GitHub Pages.
Troubleshooting
- If the workflow fails, ensure that mkdocsis properly installed and configured.
- If deployment issues occur, verify that GitHub Actions has the required contents: writepermission.
- Check logs for any issues related to Git authentication or MkDocs execution.