ci: add Gitea Action to auto-reindex KB on markdown push

When .md files are pushed to main, the workflow sends an HMAC-signed
POST to the md-kb-rag webhook on manticore, which triggers git pull
+ incremental re-index of the knowledge base.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-12 07:04:47 -05:00
parent e9fe38ff28
commit 2900369fe0

View File

@ -0,0 +1,21 @@
name: Reindex Knowledge Base
on:
push:
branches: [main]
paths: ['**/*.md']
jobs:
reindex:
runs-on: ubuntu-latest
steps:
- name: Trigger KB re-index
env:
WEBHOOK_SECRET: ${{ secrets.KB_WEBHOOK_SECRET }}
run: |
BODY='{"ref":"refs/heads/main"}'
SIG=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | awk '{print $2}')
curl -sf -X POST http://10.10.0.226:8001/hooks/reindex \
-H "Content-Type: application/json" \
-H "x-gitea-signature: $SIG" \
-d "$BODY"