-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (45 loc) · 1.45 KB
/
upload.yml
File metadata and controls
50 lines (45 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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