Update docs.yml #4
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: Build & Deploy EPANET2.2 Sphinx Docs | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: # allows manual runs from the Actions tab | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| DOCS_DIR: User_Manual/docs | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Sphinx dependencies | |
| run: | | |
| pip install -r ${{ env.DOCS_DIR }}/requirements.txt | |
| - name: Build HTML | |
| run: | | |
| sphinx-build -b html ${{ env.DOCS_DIR }} ${{ env.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 | |
| permissions: | |
| pages: write # to push to the github-pages environment | |
| id-token: write # required for OIDC deployment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |