Skip to content

main-doc-update

main-doc-update #345

name: "Update main documentation"
on:
repository_dispatch:
types: [main-doc-update]
jobs:
update_main_docs:
name: "Update main documentation"
runs-on: "ubuntu-latest"
permissions: write-all
env:
FROM_TAG: ${{ github.event.client_payload.tag }}
steps:
- name: "Checkout the repository (main)"
if: ${{ github.event.client_payload.tag == 'dev' }}
uses: actions/checkout@v4
with:
ref: main
- name: "Checkout the repository (stable)"
if: ${{ github.event.client_payload.tag != 'dev' }}
uses: actions/checkout@v4
with:
ref: stable
- name: "Download the new content for the main documentation"
run: |
cd "docs"
rm "index.md" || true
wget "https://github.com/RiverBench/RiverBench/releases/download/${FROM_TAG}/index.md"
cd datasets
rm "table.md" || true
wget -O "table.md" "https://github.com/RiverBench/RiverBench/releases/download/${FROM_TAG}/dataset_table.md"
cd ../results
rm "table.md" || true
wget -O "table.md" "https://github.com/RiverBench/RiverBench/releases/download/${FROM_TAG}/benchmark_results_table.md"
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: ${{ format('Automatic docs update ({0})', github.event.client_payload.tag) }}
default_author: github_actions
add: docs/*
pull: '--rebase --autostash'
push: true
- name: "Trigger doc compilation"
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT_DOC_REPO_HOOKS }}
event-type: compile-docs
client-payload: '{ "tag": "${{ github.event.client_payload.tag }}" }'