Merge pull request #255 from ICAMS/minor_tweaks_to_ptrfd #7
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 docs to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| # Allow only one concurrent deployment, skipping runs queued between the run | |
| # in-progress and latest queued. Do NOT cancel in-progress runs so a deploy | |
| # always finishes. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Build the Sphinx site on every push and PR (PRs get build validation | |
| # without deploying). | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up conda docs environment | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| channels: conda-forge | |
| environment-file: environment-docs.yml | |
| activate-environment: calphy-docs | |
| - name: Install calphy + doc requirements | |
| run: | | |
| pip install . | |
| pip install -r docs/requirements.txt | |
| - name: Build the documentation | |
| run: | | |
| sphinx-build -b html docs/source docs/_build/html | |
| - name: Upload Pages artifact | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/_build/html | |
| # Deploy to GitHub Pages, only on push to main. | |
| deploy: | |
| needs: build | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| permissions: | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |