From c354998e1193c2389f39c973d3b8fad05c7fda11 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sun, 2 Aug 2026 00:00:10 +0100 Subject: [PATCH] ci/docs: Regenerate docs on master Run both documentation generators after master updates and commit their outputs only when the generated files change. --- .gitea/workflows/update-docs.yaml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .gitea/workflows/update-docs.yaml diff --git a/.gitea/workflows/update-docs.yaml b/.gitea/workflows/update-docs.yaml new file mode 100644 index 0000000..6c8b5bf --- /dev/null +++ b/.gitea/workflows/update-docs.yaml @@ -0,0 +1,41 @@ +name: Update docs + +on: + push: + branches: [master] + +jobs: + update: + if: "!contains(github.event.head_commit.message, 'docs: update generated tables')" + runs-on: ubuntu-26.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v6 + + - uses: cachix/install-nix-action@v31 + with: + github_access_token: ${{ secrets.GH_PULL_TOKEN }} + extra_nix_config: | + extra-substituters = https://nix-cache.nul.ie + extra-trusted-public-keys = nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4= + + - name: Update assignment tables + run: nix run .#update-docs-assignments + + - name: Update option reference + run: nix run .#update-docs-options + + - name: Commit and push if changed + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + REPO_URL: ${{ gitea.repositoryUrl }} + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git remote set-url origin "${REPO_URL/https:\/\//https:\/\/oauth2:${GITEA_TOKEN}@}" + git add docs/ + if ! git diff --cached --quiet; then + git commit -m "docs: update generated tables" + git push + fi