forked from livestorejs/livestore
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.77 KB
/
Copy pathsync-docs.yml
File metadata and controls
61 lines (52 loc) · 1.77 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
51
52
53
54
55
56
57
58
59
60
61
name: Sync docs to Mixedbread Vector Store
on:
workflow_dispatch:
inputs:
target:
description: 'Docs search target to sync'
required: true
default: 'dev'
type: choice
options:
- dev
- prod
push:
branches: [main]
paths:
- docs/src/content/**/*.md
- docs/src/content/**/*.mdx
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 11.3.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Sync vector store
shell: bash
working-directory: ./docs
env:
MXBAI_API_KEY: ${{ secrets.MXBAI_API_KEY }}
MXBAI_VECTOR_STORE_ID_DEV: ${{ secrets.MXBAI_VECTOR_STORE_ID_DEV }}
MXBAI_VECTOR_STORE_ID_PROD: ${{ secrets.MXBAI_VECTOR_STORE_ID_PROD }}
MXBAI_VECTOR_STORE_ID_LEGACY: ${{ secrets.MXBAI_VECTOR_STORE_ID }}
SYNC_TARGET: ${{ github.event_name == 'workflow_dispatch' && inputs.target || 'dev' }}
run: |
set -euo pipefail
: "${MXBAI_API_KEY:?Missing MXBAI_API_KEY secret}"
if [ "$SYNC_TARGET" = "prod" ]; then
vector_store_id="${MXBAI_VECTOR_STORE_ID_PROD:-}"
else
vector_store_id="${MXBAI_VECTOR_STORE_ID_DEV:-${MXBAI_VECTOR_STORE_ID_LEGACY:-}}"
fi
: "${vector_store_id:?Missing Mixedbread vector store id for target ${SYNC_TARGET}}"
pnpm dlx @mixedbread/cli@2.3.2 store sync "$vector_store_id" "./src/content/**/*.mdx" "./src/content/**/*.md" --yes --strategy fast