69 lines
2.0 KiB
YAML
69 lines
2.0 KiB
YAML
name: Generate documentation
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- "docs/generated/**"
|
|
- "docs/diagrams/**"
|
|
- "docs/public/**"
|
|
- "site/**"
|
|
pull_request:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- "docs/generated/**"
|
|
- "docs/diagrams/**"
|
|
- "docs/public/**"
|
|
- "site/**"
|
|
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
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install tooling
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y graphviz jq python3 python3-pip
|
|
if ! docker compose version >/dev/null 2>&1; then
|
|
sudo apt-get install -y docker-compose-v2 || sudo apt-get install -y docker-compose || true
|
|
fi
|
|
if ! docker compose version >/dev/null 2>&1; then
|
|
echo "docker compose CLI is unavailable on this runner" >&2
|
|
exit 1
|
|
fi
|
|
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 == 'push' ||
|
|
(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
|