chore: fix conflict #8
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] | |
| paths: | |
| - 'zh/**' | |
| - 'en/**' | |
| - 'docs.json' | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Target environment' | |
| required: true | |
| default: 'production' | |
| type: choice | |
| options: | |
| - production | |
| - development | |
| full_upload: | |
| description: 'Re-upload all docs (use after clearing index or changing settings)' | |
| required: false | |
| default: false | |
| type: boolean | |
| 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 | |
| with: | |
| # Need history for git diff in incremental mode | |
| fetch-depth: 2 | |
| - 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 }} | |
| FULL_UPLOAD: ${{ github.event.inputs.full_upload || 'false' }} | |
| run: | | |
| chmod +x ./scripts/upload.sh | |
| bash ./scripts/upload.sh |