chore(workflow): add workflow to deploy documentation as github pages#98
chore(workflow): add workflow to deploy documentation as github pages#98jonperron wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new GitHub Actions workflow to automatically build Sphinx documentation and deploy it to GitHub Pages. The workflow builds documentation on push, pull requests, and manual triggers, but only deploys to GitHub Pages when pushing to the main branch.
Key Changes:
- New workflow file that installs Sphinx dependencies, builds documentation, and deploys to GitHub Pages
- Uses Python 3.10 with Sphinx, sphinx_rtd_theme, and myst_parser
- Conditional deployment only on main branch pushes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 |
There was a problem hiding this comment.
Inconsistent action version usage across workflows. Other workflows in the repository (tests.yaml and pre-commit_ci.yaml) use actions/setup-python@v4. Consider using v4 for consistency, or update all workflows to v5.
| - uses: actions/setup-python@v5 | |
| - uses: actions/setup-python@v4 |
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' |
There was a problem hiding this comment.
Missing pip upgrade before installing dependencies. Other workflows in the repository upgrade pip first with 'python -m pip install --upgrade pip'. This ensures the latest pip version is used and avoids potential compatibility issues.
| python-version: '3.10' | |
| python-version: '3.10' | |
| - name: Upgrade pip | |
| run: python -m pip install --upgrade pip |
| python-version: '3.10' | ||
| - name: Install dependencies | ||
| run: | | ||
| pip install sphinx sphinx_rtd_theme myst_parser |
There was a problem hiding this comment.
Dependencies are installed without version constraints. Consider pinning versions (e.g., 'sphinx<8', 'sphinx_rtd_theme<3', 'myst_parser<3') to ensure reproducible builds and prevent breaking changes from future dependency updates.
| pip install sphinx sphinx_rtd_theme myst_parser | |
| pip install 'sphinx<8' 'sphinx_rtd_theme<3' 'myst_parser<3' |
| @@ -0,0 +1,29 @@ | |||
| name: Deploy Documentation | |||
|
|
|||
| on: [push, pull_request, workflow_dispatch] | |||
There was a problem hiding this comment.
The workflow triggers on all push and pull_request events but only deploys on main branch pushes (line 24). This causes unnecessary workflow runs and resource usage for builds that won't be deployed. Consider triggering on 'push: branches: [main]' and 'workflow_dispatch' only, or add a conditional check earlier in the job.
| on: [push, pull_request, workflow_dispatch] | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: |
No description provided.