Debian Codegraph @

ansible_collections/community/dns/.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.dns
25 init-lenient: false
26 init-fail-on-error: true
27 squash-hierarchy: true
28 init-project: Community.Dns Collection
29 init-copyright: Community.Dns Contributors
30 init-title: Community.Dns Collection Documentation
31 init-html-short-title: Community.Dns Collection Docs
32 init-extra-html-theme-options: |
33 documentation_home_url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/branch/main/
34 render-file-line: >-
35 > * `$<status>` [$<path_tail>](https://${{
36 github.repository_owner
37 }}.github.io/${{
38 github.event.repository.name
39 }}/pr/${{
40 github.event.number
41 }}/$<path_tail>)
42 extra-collections: community.library_inventory_filtering_v1
43
44 publish-docs-gh-pages:
45 # for now we won't run this on forks
46 if: github.repository == 'ansible-collections/community.dns'
47 permissions:
48 contents: write
49 pages: write
50 id-token: write
51 needs: [build-docs]
52 name: Publish Ansible Docs
53 uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main
54 with:
55 artifact-name: ${{ needs.build-docs.outputs.artifact-name }}
56 action: ${{ (github.event.action == 'closed' || needs.build-docs.outputs.changed != 'true') && 'teardown' || 'publish' }}
57 publish-gh-pages-branch: true
58 secrets:
59 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60
61 comment:
62 permissions:
63 pull-requests: write
64 runs-on: ubuntu-latest
65 needs: [build-docs, publish-docs-gh-pages]
66 name: PR comments
67 steps:
68 - name: PR comment
69 uses: ansible-community/github-docs-build/actions/ansible-docs-build-comment@main
70 with:
71 body-includes: '## Docs Build'
72 reactions: heart
73 action: ${{ needs.build-docs.outputs.changed != 'true' && 'remove' || '' }}
74 on-closed-body: |
75 ## Docs Build 📝
76
77 This PR is closed and any previously published docsite has been unpublished.
78 on-merged-body: |
79 ## Docs Build 📝
80
81 Thank you for contribution!✨
82
83 This PR has been merged and the docs are now incorporated into `main`:
84 ${{ env.GHP_BASE_URL }}/branch/main
85 body: |
86 ## Docs Build 📝
87
88 Thank you for contribution!✨
89
90 The docs for **this PR** have been published here:
91 ${{ env.GHP_BASE_URL }}/pr/${{ github.event.number }}
92
93 You can compare to the docs for the `main` branch here:
94 ${{ env.GHP_BASE_URL }}/branch/main
95
96 The docsite for **this PR** is also available for download as an artifact from this run:
97 ${{ needs.build-docs.outputs.artifact-url }}
98
99 File changes:
100
101 ${{ needs.build-docs.outputs.diff-files-rendered }}
102
103 ${{ needs.build-docs.outputs.diff-rendered }}