Update GitHub Actions to use 'main' branch #120
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: Documentation | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-pages: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.11' | |
| - name: Change permissions of /var/log/ | |
| run: sudo chmod a+w /var/log/ | |
| # Build the documentation | |
| - name: Build the documentation | |
| run: | | |
| pip install -r requirements.txt | |
| cd docs | |
| make html | |
| - name: Upload artifacts | |
| id: deployment | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/build/html/ | |
| # Deploy the documentation, only on pushes to main (never on pull requests) | |
| deploy-page: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| needs: build-pages | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |