|
| 1 | +# Simple workflow for deploying static content to GitHub Pages |
| 2 | +name: Deploy documentation to Pages |
| 3 | + |
| 4 | +on: |
| 5 | + # Runs on pushes targeting the default branch |
| 6 | + push: |
| 7 | + branches: ["develop"] |
| 8 | + |
| 9 | + # Allows you to run this workflow manually from the Actions tab |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + id-token: write |
| 17 | + |
| 18 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 19 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 20 | +concurrency: |
| 21 | + group: "pages" |
| 22 | + cancel-in-progress: false |
| 23 | + |
| 24 | +env: |
| 25 | + POETRY_VERSION: "1.3.1" |
| 26 | + PYTHON_VERSION: "3.10" |
| 27 | + |
| 28 | +jobs: |
| 29 | + deploy: |
| 30 | + environment: |
| 31 | + name: github-pages |
| 32 | + url: ${{ steps.deployment.outputs.page_url }} |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: getsentry/action-github-app-token@v2 |
| 36 | + name: podaac cicd token |
| 37 | + id: podaac-cicd |
| 38 | + with: |
| 39 | + app_id: ${{ secrets.CICD_APP_ID }} |
| 40 | + private_key: ${{ secrets.CICD_APP_PRIVATE_KEY }} |
| 41 | + - uses: actions/checkout@v3 |
| 42 | + with: |
| 43 | + repository: ${{ github.repository }} |
| 44 | + token: ${{ steps.podaac-cicd.outputs.token }} |
| 45 | + - uses: actions/setup-python@v4 |
| 46 | + with: |
| 47 | + python-version: ${{ env.PYTHON_VERSION }} |
| 48 | + - name: Install Poetry |
| 49 | + uses: abatilo/actions-poetry@v2 |
| 50 | + with: |
| 51 | + poetry-version: ${{ env.POETRY_VERSION }} |
| 52 | + |
| 53 | + # Build the book |
| 54 | + - name: Build the book |
| 55 | + run: | |
| 56 | + poetry lock --no-update |
| 57 | + poetry run jupyter-book build docs/ |
| 58 | +
|
| 59 | + - name: Setup Pages |
| 60 | + uses: actions/configure-pages@v3 |
| 61 | + - name: Upload artifact |
| 62 | + uses: actions/upload-pages-artifact@v2 |
| 63 | + with: |
| 64 | + # Upload only docs repository |
| 65 | + path: 'docs/_build/html' |
| 66 | + - name: Deploy to GitHub Pages |
| 67 | + id: deployment |
| 68 | + uses: actions/deploy-pages@v2 |
0 commit comments