Automated Ansible Role Documentation #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Automated Ansible Role Documentation | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
paths: | |
- 'roles/**/meta/argument_specs.yml' | |
- 'roles/**/meta/main.yml' | |
pull_request: | |
branches: ["main"] | |
paths: | |
- 'roles/**/meta/argument_specs.yml' | |
- 'roles/**/meta/main.yml' | |
jobs: | |
aar_docs: | |
name: create roles readme | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
roles: | |
- access_conf | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install aar_doc | |
run: pip3 install aar_doc | |
- name: Run aar_doc | |
run: aar_doc --output-template .aar_doc-markdown.j2 roles/${{ matrix.roles }} markdown | |
- name: Output diff | |
run: git diff roles/${{ matrix.roles }}/README.md | |
- name: Push README | |
if: github.event_name != 'pull_request' | |
uses: github-actions-x/commit@v2.9 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'Update ${{ matrix.roles }} README' | |
files: roles/${{ matrix.roles }}/README.md | |
rebase: true | |
name: Server Baseline Workflows | |
email: nb623107@gmail.com |