Add Meilisearch upload workflow and script for AI Q&A bot indexing #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Upload documentation to Meilisearch for AI Q&A bot indexing. | |
| # | |
| # 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 write permission | |
| # MEILI_INDEX - Target index name | |
| # | |
| # Branch mapping: main -> production, test -> development | |
| name: Upload docs to Meilisearch | |
| on: | |
| push: | |
| branches: [main, test] | |
| 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') }} | |
| 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 |