docs: add automated compose documentation generation pipeline
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
name: Generate documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- "docs/generated/**"
|
||||
- "docs/diagrams/**"
|
||||
- "docs/public/**"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- "docs/generated/**"
|
||||
- "docs/diagrams/**"
|
||||
- "docs/public/**"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
commit_generated_docs:
|
||||
description: "Commit generated docs back to the branch"
|
||||
required: false
|
||||
default: "false"
|
||||
type: choice
|
||||
options: ["false", "true"]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
generate-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install tooling
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y docker-compose-plugin graphviz jq python3 python3-pip
|
||||
python3 -m pip install --user pyyaml jinja2
|
||||
- name: Generate documentation
|
||||
run: |
|
||||
chmod +x scripts/docs/*.sh
|
||||
scripts/docs/generate-all.sh
|
||||
- name: Upload generated documentation
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: generated-documentation
|
||||
path: |
|
||||
docs/generated
|
||||
docs/diagrams
|
||||
docs/public
|
||||
- name: Commit generated docs
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.commit_generated_docs == 'true'
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "docs: regenerate environment documentation"
|
||||
file_pattern: docs/generated docs/diagrams docs/public
|
||||
Reference in New Issue
Block a user