Monty API Docs #5
This file contains 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: Monty API Docs | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
on: | |
workflow_run: | |
workflows: | |
- Monty | |
branches: | |
- main | |
types: | |
- completed | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
deploy_sphinx_monty_api_docs: | |
name: deploy-sphinx-monty-api-docs | |
runs-on: ubuntu-latest | |
if: ${{ (github.repository_owner == 'thousandbrainsproject') && (github.event.workflow_run.conclusion == 'success') }} | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout tbp.monty | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
path: tbp.monty | |
# We want to deploy the docs using the same criteria for deciding if Monty code changed. | |
- name: Should Run Monty API Docs | |
id: should_run_monty_api_docs | |
uses: ./tbp.monty/.github/actions/should_run_monty | |
with: | |
git_base_ref: ${{ github.event.workflow_run.head_branch }} | |
git_sha: ${{ github.event.workflow_run.head_sha }} | |
github_event_name: ${{ github.event.workflow_run.event }} | |
working_directory: tbp.monty | |
# Downloading the artifact from the previous run so that actions/deploy-pages can find it. | |
- name: Download artifact | |
if: ${{ steps.should_run_monty_api_docs.outputs.should_run_monty == 'true'}} | |
uses: actions/download-artifact@v4 | |
with: | |
name: github-pages-${{ github.sha }} | |
run-id: ${{ github.event.workflow_run.id }} | |
- name: Upload artifact | |
if: ${{ steps.should_run_monty_api_docs.outputs.should_run_monty == 'true'}} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: github-pages-${{ github.sha }} | |
path: github-pages-${{ github.sha }} | |
- name: Deploy Monty API docs | |
id: deployment | |
if: ${{ steps.should_run_monty_api_docs.outputs.should_run_monty == 'true'}} | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: github-pages-${{ github.sha }} |