Update docs.yml #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: Deploy EPANET 2.2 docs to GitHub Pages | |
| on: | |
| push: | |
| branches: [ master ] # or main | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: write # gh-pages push | |
| pages: write | |
| id-token: write | |
| env: | |
| DOCS_DIR: User_Manual/docs # ← centralised path | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Sphinx + theme | |
| run: pip install -r $DOCS_DIR/requirements.txt | |
| - name: Build HTML | |
| run: sphinx-build -b html $DOCS_DIR $DOCS_DIR/_build/html | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ${{ env.DOCS_DIR }}/_build/html | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages # GitHub creates this env automatically | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |