diff --git a/.gitea/workflows/kb-reindex.yml b/.gitea/workflows/kb-reindex.yml new file mode 100644 index 0000000..7a234d2 --- /dev/null +++ b/.gitea/workflows/kb-reindex.yml @@ -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"