Skip to content

schema-doc-update

schema-doc-update #18

name: "Update schema documentation"
on:
repository_dispatch:
types: [schema-doc-update]
jobs:
update-schema-docs:
name: "Update schema documentation"
# Only one job at a time, to avoid confflicts.
concurrency: doc-update
runs-on: "ubuntu-latest"
permissions: write-all
env:
FROM_TAG: ${{ github.event.client_payload.tag }}
steps:
- name: "Checkout the repository"
uses: actions/checkout@v3
with:
ref: main
- name: "Download the new content"
run: |
VERSION_ID="${FROM_TAG#v}"
cd "docs/schema"
mkdir "./temp"
cd "./temp"
wget "https://github.com/RiverBench/schema/releases/download/${FROM_TAG}/docs.tar.gz"
tar -xzvf docs.tar.gz
for name in $(ls -1 *.md); do
mkdir -p "../${name%.md}"
mv "${name}" "../${name%.md}/${VERSION_ID}.md"
done
cd ../
rm -rf ./temp
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: ${{ format('Automatic update of schema docs ({1})', github.event.client_payload.repo, github.event.client_payload.tag) }}
default_author: github_actions
add: docs/schema/*
pull: '--rebase --autostash'
push: true
- name: "Trigger doc compilation"
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PAT_DOC_REPO_HOOKS }}
event-type: compile-docs