Refactor GitHub Actions workflow: adjust event triggers for documenta… #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Documentation Build Test | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags: | |
| - '*' | |
| pull_request: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| name: Build Documentation | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y doxygen | |
| - name: Install Python dependencies | |
| run: | | |
| pip install -r docs/requirements.txt | |
| - name: Build documentation | |
| working-directory: docs | |
| run: | | |
| make html | |
| - name: Upload artifact for GitHub Pages | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/_build/html | |
| deploy-docs: | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' | |
| needs: build-docs | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |