Repository navigation
62 lines (52 loc) · 1.99 KB
/
Copy pathdocs-sync-search.yml
File metadata and controls
62 lines (52 loc) · 1.99 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
62
name: Sync Search
on:
workflow_dispatch:
inputs:
operation:
description: Sync content or inspect the existing search stores
type: choice
default: sync-docs
options: [sync-docs, sync-website, inspect, verify]
push:
branches: [main]
paths: [apps/docs/content/docs/**/*.mdx]
concurrency:
group: ${{ inputs.operation == 'sync-website' && 'website-search-sync' || format('{0}-{1}', github.workflow, github.ref) }}
cancel-in-progress: false
permissions: {}
jobs:
test:
name: Sync Docs
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"
- name: Inspect search stores
if: ${{ inputs.operation == 'inspect' || inputs.operation == 'verify' }}
run: |
pnpm install --frozen-lockfile
pnpm --filter docs exec tsx ../../packages/ui/scripts/inspect-mixedbread.ts ${{ inputs.operation == 'verify' && '--verify' || '' }}
env:
MIXEDBREAD_API_KEY: ${{ secrets.MIXEDBREAD_API_KEY }}
- name: Upload Docs
if: ${{ inputs.operation == 'sync-docs' || github.event_name == 'push' }}
run: pnpm dlx @mixedbread/cli store sync "${MIXEDBREAD_VECTOR_STORE_ID}" "apps/docs/content/docs/**/*.mdx" --yes --strategy fast
env:
MXBAI_API_KEY: ${{ secrets.MIXEDBREAD_API_KEY }}
MIXEDBREAD_VECTOR_STORE_ID: ${{ secrets.MIXEDBREAD_VECTOR_STORE_ID }}
- name: Sync published website
if: ${{ inputs.operation == 'sync-website' }}
run: |
pnpm install --frozen-lockfile
pnpm --filter docs exec playwright install --with-deps chromium
pnpm --filter docs exec tsx scripts/sync-website-search.ts --write
env:
MIXEDBREAD_API_KEY: ${{ secrets.MIXEDBREAD_API_KEY }}