mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-07-23 21:30:31 -07:00
docs: add automated doc generation
This commit is contained in:
parent
a0ea9c62a7
commit
a043021e48
15 changed files with 421 additions and 4 deletions
48
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
48
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
---
|
||||
name: 🐛 Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
##### SUMMARY
|
||||
<!-- Explain the problem briefly -->
|
||||
|
||||
|
||||
##### ISSUE TYPE
|
||||
- Bug Report
|
||||
|
||||
|
||||
##### ANSIBLE VERSION
|
||||
<!-- Paste, BELOW THIS COMMENT, verbatim output from "ansible --version"-->
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
##### COLLECTION VERSION
|
||||
<!-- Paste, BELOW THIS COMMENT, verbatim output from "ansible-galaxy collection list"-->
|
||||
<!-- If using virtual environments or execution environments, remember to activate them-->
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
##### STEPS TO REPRODUCE
|
||||
<!-- List the steps to reproduce the problem, using a minimal test-case. -->
|
||||
|
||||
<!-- Paste example playbook below -->
|
||||
```yaml
|
||||
|
||||
```
|
||||
|
||||
##### EXPECTED RESULTS
|
||||
<!-- What did you expect to happen when running the steps above? -->
|
||||
|
||||
|
||||
##### ACTUAL RESULTS
|
||||
<!-- What actually happened? If possible run with extra verbosity (-vvvv) and diff (--diff) -->
|
||||
<!-- Please also include check mode (--check --diff) output if the API returns an error -->
|
||||
<!-- Be sure to mask any sensitive information -->
|
||||
|
||||
<!--- Paste verbatim command output between quotes below -->
|
||||
```
|
||||
|
||||
```
|
12
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
12
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
name: ✨ Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
##### SUMMARY
|
||||
<!--- Explain the problem briefly -->
|
||||
|
||||
|
||||
##### ISSUE TYPE
|
||||
- Feature Idea
|
75
.github/workflows/docs.yml
vendored
Normal file
75
.github/workflows/docs.yml
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
---
|
||||
name: Documentation
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "*.*.*"
|
||||
|
||||
env:
|
||||
COLORTERM: 'yes'
|
||||
TERM: 'xterm-256color'
|
||||
PYTEST_ADDOPTS: '--color=yes'
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'ansible-middleware/keycloak'
|
||||
permissions:
|
||||
actions: write
|
||||
checks: write
|
||||
contents: write
|
||||
deployments: write
|
||||
packages: write
|
||||
pages: write
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: ansible_collections/middleware_automation/keycloak
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
|
||||
- name: Install doc dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r ansible_collections/middleware_automation/keycloak/docs/requirements.txt
|
||||
pip install -r ansible_collections/middleware_automation/keycloak/requirements.txt
|
||||
|
||||
- name: Create default collection path
|
||||
run: |
|
||||
mkdir -p /home/runner/.ansible/collections/ansible_collections
|
||||
|
||||
- name: Create doc directories and resources
|
||||
run: |
|
||||
mkdir -p ./docs/plugins ./docs/roles
|
||||
cat ./docs/roles.rst.template > ./docs/roles/index.rst
|
||||
antsibull-docs collection --use-current --squash-hierarchy --dest-dir docs/plugins middleware_automation.keycloak
|
||||
for role_readme in roles/*/README.md; do ln -f -s ../../$role_readme ./docs/roles/$(basename $(dirname $role_readme)).md; echo " * :doc:\`$(basename $(dirname $role_readme))\`" >> ./docs/roles/index.rst; done
|
||||
working-directory: ansible_collections/middleware_automation/keycloak
|
||||
|
||||
- name: Run sphinx
|
||||
run: |
|
||||
sphinx-build -M html . _build -v
|
||||
working-directory: ansible_collections/middleware_automation/keycloak/docs/
|
||||
|
||||
- name: Commit docs
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
git checkout gh-pages
|
||||
rm -rf $(basename ${GITHUB_REF})
|
||||
mv docs/_build/html $(basename ${GITHUB_REF})
|
||||
ln --force --no-dereference --symbolic main latest
|
||||
git show origin/main:docs/_gh_include/header.inc > index.html
|
||||
(echo main; echo latest; dirname *.*.*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '<li class="toctree-l1"><a class="reference internal" href="@@/">@@</a></li>' >> index.html
|
||||
git show origin/main:docs/_gh_include/footer.inc >> index.html
|
||||
git add $(basename ${GITHUB_REF}) latest index.html
|
||||
git commit -m "Update docs for $(basename ${GITHUB_REF})" || true
|
||||
git push origin gh-pages
|
||||
working-directory: ansible_collections/middleware_automation/keycloak/
|
Loading…
Add table
Add a link
Reference in a new issue