Files
docker/.github/workflows/generate-docs.yml
T

63 lines
1.8 KiB
YAML

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 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 == '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