Deploy docs-site #3
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-site | |
| on: | |
| workflow_run: | |
| workflows: | |
| - "Deploy development docs" | |
| - "Deploy release docs" | |
| - "Repair release docs" | |
| types: [completed] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: docs-site-deploy-${{ github.repository }} | |
| cancel-in-progress: false | |
| jobs: | |
| upload: | |
| if: github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has_site: ${{ steps.site-check.outputs.has_site }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.repository.default_branch }} | |
| fetch-depth: 1 | |
| path: workflow | |
| - name: Check for a published docs-site branch | |
| id: site-check | |
| working-directory: workflow | |
| run: | | |
| if git ls-remote --exit-code origin refs/heads/docs-site >/dev/null 2>&1; then | |
| echo "has_site=true" >> "$GITHUB_OUTPUT" | |
| else | |
| status=$? | |
| if [ "$status" -eq 2 ]; then echo "has_site=false" >> "$GITHUB_OUTPUT"; else exit 1; fi | |
| fi | |
| - uses: actions/checkout@v4 | |
| if: steps.site-check.outputs.has_site == 'true' | |
| with: | |
| ref: docs-site | |
| fetch-depth: 1 | |
| path: docs-site | |
| - uses: actions/upload-pages-artifact@v3 | |
| if: steps.site-check.outputs.has_site == 'true' | |
| with: | |
| path: docs-site | |
| deploy: | |
| if: github.event.workflow_run.conclusion == 'success' && needs.upload.outputs.has_site == 'true' | |
| needs: upload | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |