Skip to content

Merge pull request #422 from flashcatcloud/fix/webhook-payload-protocol #328

Merge pull request #422 from flashcatcloud/fix/webhook-payload-protocol

Merge pull request #422 from flashcatcloud/fix/webhook-payload-protocol #328

Workflow file for this run

# Upload documentation to Meilisearch for AI Q&A bot indexing.
#
# Every run syncs the whole doc set: all docs are upserted and index documents
# whose source file is gone are deleted.
#
# Uses GitHub Environments for dev/prod separation. Create two environments in
# Settings > Environments: "development" and "production".
#
# Per-environment secrets (all required, keep as secrets to hide Meilisearch endpoint):
# MEILI_ENDPOINT - Meilisearch instance URL
# MEILI_API_KEY - API key with documents read/write permission
# MEILI_INDEX - Target index name
#
# Branch mapping: main -> production, test -> development
name: Upload docs to Meilisearch
on:
push:
branches: [main, test]
paths:
- 'zh/**'
- 'en/**'
- 'docs.json'
workflow_dispatch:
inputs:
environment:
description: 'Target environment'
required: true
default: 'production'
type: choice
options:
- production
- development
jobs:
upload:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'production' || 'development') }}
# One sync per index at a time: an older run listing the index while a
# newer one uploads would delete the newer run's added docs.
concurrency:
group: meilisearch-upload-${{ github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'production' || 'development') }}
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq
jq --version
- name: Upload to Meilisearch
env:
MEILI_ENDPOINT: ${{ secrets.MEILI_ENDPOINT }}
MEILI_API_KEY: ${{ secrets.MEILI_API_KEY }}
MEILI_INDEX: ${{ secrets.MEILI_INDEX }}
run: |
chmod +x ./scripts/upload.sh
bash ./scripts/upload.sh