Debian Codegraph @

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