Skip to content

Commit 2d55b12

Browse files
authoredJul 25, 2022
automated docs builds (ansible-collections#388)
* add docs-build workflows * add collection links * remove manually generated RST
1 parent c7d0896 commit 2d55b12

File tree

46 files changed

+144
-16055
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+144
-16055
lines changed
 

‎.github/workflows/docs-pr.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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 }}

‎.github/workflows/docs-push.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Collection Docs
2+
concurrency:
3+
group: docs-push-${{ github.sha }}
4+
cancel-in-progress: true
5+
on:
6+
push:
7+
branches:
8+
- main
9+
tags:
10+
- '*'
11+
schedule:
12+
- cron: '0 13 * * *'
13+
14+
jobs:
15+
build-docs:
16+
permissions:
17+
contents: read
18+
name: Build Ansible Docs
19+
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-push.yml@main
20+
with:
21+
init-lenient: false
22+
init-fail-on-error: true
23+
24+
publish-docs-gh-pages:
25+
# use to prevent running on forks
26+
if: github.repository == 'ansible-collections/ansible.windows'
27+
permissions:
28+
contents: write
29+
needs: [build-docs]
30+
name: Publish Ansible Docs
31+
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main
32+
with:
33+
artifact-name: ${{ needs.build-docs.outputs.artifact-name }}
34+
secrets:
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)