Merge pull request #339 from Deltares/feature/329-copy-contributing-s… #95
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: docs | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| - feature/PROB-207-docs-as-subpage | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1️⃣ Checkout the repository | |
| - uses: actions/checkout@v4 | |
| # 2️⃣ Set up Python | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| # 3️⃣ Install Poetry | |
| - name: Install Poetry | |
| run: curl -sSL https://install.python-poetry.org | python3 - | |
| working-directory: sources/Deltares.Probabilistic.Python | |
| - name: Add Poetry to PATH | |
| run: echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
| - name: Show current pyproject.toml | |
| run: cat sources/Deltares.Probabilistic.Python/pyproject.toml | |
| # 4️⃣ Install Python dependencies | |
| - name: Install Python dependencies | |
| run: poetry install | |
| working-directory: sources/Deltares.Probabilistic.Python | |
| - name: Install Pandoc | |
| run: sudo apt-get install -y pandoc # for ubuntu | |
| # For Windows runners, you can use Chocolatey: | |
| # choco install pandoc -y | |
| # 5️⃣ Set up Node.js for Mermaid CLI | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| # 6️⃣ Install Mermaid CLI globally | |
| - run: npm install -g @mermaid-js/mermaid-cli | |
| # 7️⃣ Build Sphinx documentation | |
| - name: Build Sphinx docs | |
| run: | | |
| poetry --directory sources/Deltares.Probabilistic.Python \ | |
| run sphinx-build -b html -a -E ../../web ../../web/build/html | |
| # 8️⃣ Upload HTML docs as artifact for GitHub Pages | |
| - uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: web/build/html | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |