docs: move public docs generation to local workflow
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Generate documentation
|
||||
name: Validate committed public docs
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -16,53 +16,16 @@ on:
|
||||
- "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
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
generate-docs:
|
||||
validate-public-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install tooling
|
||||
- name: Ensure committed docs/public exists
|
||||
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
|
||||
test -d docs/public
|
||||
test -n "$(find docs/public -mindepth 1 -print -quit)"
|
||||
|
||||
Reference in New Issue
Block a user