Debian Codegraph @

ansible_collections/community/hrobot/.github/workflows/docs-pr.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 name: Collection Docs
7 concurrency:
8 group: docs-pr-${{ github.head_ref }}
9 cancel-in-progress: true
10 'on':
11 pull_request_target:
12 types: [opened, synchronize, reopened, closed]
13
14 env:
15 GHP_BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
16
17 jobs:
18 build-docs:
19 permissions:
20 contents: read
21 name: Build Ansible Docs
22 uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-pr.yml@main
23 with:
24 collection-name: community.hrobot
25 init-lenient: false
26 init-fail-on-error: true
27 init-project: Community.Hrobot Collection
28 init-copyright: Community.Hrobot Contributors
29 init-title: Community.Hrobot Collection Documentation
30 init-html-short-title: Community.Hrobot Collection Docs
31 init-extra-html-theme-options: |
32 documentation_home_url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/branch/main/
33 squash-hierarchy: true
34 render-file-line: '> * `$<status>` [$<path_tail>](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr/${{ github.event.number }}/$<path_tail>)'
35 extra-collections: community.library_inventory_filtering_v1
36
37 publish-docs-gh-pages:
38 # for now we won't run this on forks
39 if: github.repository == 'ansible-collections/community.hrobot'
40 permissions:
41 contents: write
42 pages: write
43 id-token: write
44 needs: [build-docs]
45 name: Publish Ansible Docs
46 uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main
47 with:
48 artifact-name: ${{ needs.build-docs.outputs.artifact-name }}
49 action: ${{ (github.event.action == 'closed' || needs.build-docs.outputs.changed != 'true') && 'teardown' || 'publish' }}
50 publish-gh-pages-branch: true
51 secrets:
52 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
54 comment:
55 permissions:
56 pull-requests: write
57 runs-on: ubuntu-latest
58 needs: [build-docs, publish-docs-gh-pages]
59 name: PR comments
60 steps:
61 - name: PR comment
62 uses: ansible-community/github-docs-build/actions/ansible-docs-build-comment@main
63 with:
64 body-includes: '## Docs Build'
65 reactions: heart
66 action: ${{ needs.build-docs.outputs.changed != 'true' && 'remove' || '' }}
67 on-closed-body: |
68 ## Docs Build 📝
69
70 This PR is closed and any previously published docsite has been unpublished.
71 on-merged-body: |
72 ## Docs Build 📝
73
74 Thank you for contribution!✨
75
76 This PR has been merged and the docs are now incorporated into `main`:
77 ${{ env.GHP_BASE_URL }}/branch/main
78 body: |
79 ## Docs Build 📝
80
81 Thank you for contribution!✨
82
83 The docs for **this PR** have been published here:
84 ${{ env.GHP_BASE_URL }}/pr/${{ github.event.number }}
85
86 You can compare to the docs for the `main` branch here:
87 ${{ env.GHP_BASE_URL }}/branch/main
88
89 The docsite for **this PR** is also available for download as an artifact from this run:
90 ${{ needs.build-docs.outputs.artifact-url }}
91
92 File changes:
93
94 ${{ needs.build-docs.outputs.diff-files-rendered }}
95
96 ${{ needs.build-docs.outputs.diff-rendered }}