comment out workflow job to remove; modify link to sample build for PRs #24
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: | |
| push: | |
| branches: | |
| - develop | |
| - feature/* | |
| - main/* | |
| - bugfix/* | |
| - release/* | |
| paths: | |
| - docs/** | |
| pull_request_target: | |
| types: [issues, opened, reopened, synchronize] | |
| paths: | |
| - docs/** | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to build documentation for' | |
| required: false | |
| default: 'develop' | |
| commit: | |
| description: 'Commit to build documentation for' | |
| required: false | |
| default: 'HEAD' | |
| jobs: | |
| documentation: | |
| permissions: | |
| pull-requests: "write" | |
| runs-on: ubuntu-latest | |
| name: Build and deploy documentation | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install (upgrade) python dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install -r docs/requirements.txt | |
| - name: Install (upgrade) latex dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install texlive-latex-base | |
| sudo apt-get install texlive-fonts-recommended texlive-fonts-extra | |
| sudo apt-get install texlive-latex-extra | |
| sudo apt-get install latexmk | |
| - name: Build documentation | |
| run: | | |
| cd docs | |
| make html | |
| make latexpdf | |
| - name: Upload documentation (on success) | |
| uses: actions/upload-artifact@v4 | |
| if: success() | |
| with: | |
| name: ee-docs.pdf | |
| path: docs/_build/latex/ee-docs.pdf | |
| if-no-files-found: ignore | |
| # - name: Upload warnings (on failure) | |
| # uses: actions/upload-artifact@v4 | |
| # if: failure() | |
| # with: | |
| # name: ee-docs.warnings.log | |
| # path: docs/_build/warnings.log | |
| # if-no-files-found: ignore | |
| # | |
| - name: Comment ReadDocs Link in PR | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const message = ` | |
| Link to ReadTheDocs sample build for this PR can be found at: | |
| https://nws-hpc-standards--${{ github.event.pull_request.number }}.org.readthedocs.build/en/${{ github.event.pull_request.number }} | |
| ` | |
| github.rest.issues.createComment({ | |
| issue_number: context.pull_request.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: message | |
| }) |