|
| 1 | +name: Collection Docs |
| 2 | +concurrency: |
| 3 | + group: docs-pr-${{ github.head_ref }} |
| 4 | + cancel-in-progress: true |
| 5 | +on: |
| 6 | + pull_request_target: |
| 7 | + types: [opened, synchronize, reopened, closed] |
| 8 | + |
| 9 | +env: |
| 10 | + GHP_BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }} |
| 11 | + |
| 12 | +jobs: |
| 13 | + # Validation job runs a strict build to ensure it will fail CI on any mistakes. |
| 14 | + validate-docs: |
| 15 | + permissions: |
| 16 | + contents: read |
| 17 | + name: Validate Ansible Docs |
| 18 | + if: github.event.action != 'closed' |
| 19 | + uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-push.yml@main |
| 20 | + with: |
| 21 | + artifact-upload: false |
| 22 | + init-lenient: false |
| 23 | + init-fail-on-error: true |
| 24 | + build-ref: refs/pull/${{ github.event.number }}/merge |
| 25 | + |
| 26 | + # The build job runs with the most lenient settings to ensure the best chance of getting |
| 27 | + # a rendered docsite that can be looked at. |
| 28 | + build-docs: |
| 29 | + permissions: |
| 30 | + contents: read |
| 31 | + name: Build Ansible Docs |
| 32 | + uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-pr.yml@main |
| 33 | + with: |
| 34 | + init-lenient: true |
| 35 | + init-fail-on-error: false |
| 36 | + |
| 37 | + comment: |
| 38 | + permissions: |
| 39 | + pull-requests: write |
| 40 | + runs-on: ubuntu-latest |
| 41 | + needs: [build-docs] |
| 42 | + name: PR comments |
| 43 | + steps: |
| 44 | + - name: PR comment |
| 45 | + uses: ansible-community/github-docs-build/actions/ansible-docs-build-comment@main |
| 46 | + with: |
| 47 | + body-includes: '## Docs Build' |
| 48 | + reactions: heart |
| 49 | + action: ${{ needs.build-docs.outputs.changed != 'true' && 'remove' || '' }} |
| 50 | + on-closed-action: remove |
| 51 | + on-merged-action: remove |
| 52 | + body: | |
| 53 | + ## Docs Build 📝 |
| 54 | +
|
| 55 | + Thank you for contribution!✨ |
| 56 | +
|
| 57 | + The docsite for **this PR** is available for download as an artifact from this run: |
| 58 | + ${{ needs.build-docs.outputs.artifact-url }} |
| 59 | +
|
| 60 | + You can compare to the docs for the `main` branch here: |
| 61 | + ${{ env.GHP_BASE_URL }}/branch/main |
| 62 | +
|
| 63 | + File changes: |
| 64 | +
|
| 65 | + ${{ needs.build-docs.outputs.diff-files-rendered }} |
| 66 | +
|
| 67 | + ${{ needs.build-docs.outputs.diff-rendered }} |
0 commit comments