Deploy Pages #74
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 Pages | |
| on: | |
| workflow_run: | |
| workflows: | |
| - Publish Docsets | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Get latest run id | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| id: get_run | |
| run: | | |
| run_id=$(gh run list \ | |
| --workflow "Publish Docsets" \ | |
| --json databaseId,conclusion \ | |
| --jq 'map(select(.conclusion=="success")) | first.databaseId') | |
| echo "run_id=$run_id" >> $GITHUB_OUTPUT | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Download site artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: site | |
| path: docs | |
| github-token: ${{ github.token }} | |
| run-id: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.id || steps.get_run.outputs.run_id }} | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: docs/ | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |