From c0daa71692bf56bf5ad24e4c0540115c298181ff Mon Sep 17 00:00:00 2001 From: Darryl Ong Date: Fri, 19 Jun 2026 18:08:33 +0800 Subject: [PATCH] Add action for automating readthedocs model page updating --- .github/workflows/update-model-table.yml | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/update-model-table.yml diff --git a/.github/workflows/update-model-table.yml b/.github/workflows/update-model-table.yml new file mode 100644 index 00000000..53cc5735 --- /dev/null +++ b/.github/workflows/update-model-table.yml @@ -0,0 +1,39 @@ +name: update-model-table + +on: + push: + branches: [master] + paths: + - 'README.md' + - 'docs/generate_model_js.py' + release: + types: [published] + +jobs: + update-model-table: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Run model table generation script + working-directory: docs + run: python generate_model_js.py + + - name: Commit and push if changed + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add docs/source/_static/models/data.js + if git diff --cached --quiet; then + echo "No changes to commit" + else + git commit -m "docs: auto-update model table [skip ci]" + git push + fi