-
Notifications
You must be signed in to change notification settings - Fork 16
77 lines (70 loc) · 2.38 KB
/
index-developer-docs.yml
File metadata and controls
77 lines (70 loc) · 2.38 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Index Developer Docs
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
inputs:
reason:
description: 'Reason for running (optional)'
required: false
default: 'Manual trigger'
dry_run:
description: 'Dry run (validate extraction without uploading)'
required: false
type: boolean
default: false
force_reindex:
description: 'Force full reindex (calls processalldocuments after upload)'
required: false
type: boolean
default: false
disable_stale_deletion_check:
description: 'Bypass 20% stale-deletion safeguard (use for one-off cleanup runs only)'
required: false
type: boolean
default: false
jobs:
run-indexer:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up mise
uses: jdx/mise-action@v4
with:
cache: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install site dependencies
run: pnpm install --frozen-lockfile
- name: Build site
run: pnpm build
- name: Install indexing dependencies
working-directory: scripts/indexing
run: uv sync
- name: Run indexing script
working-directory: scripts/indexing
env:
GLEAN_INDEXING_API_TOKEN: ${{ secrets.GLEAN_INDEXING_API_TOKEN }}
GLEAN_INSTANCE: ${{ secrets.GLEAN_INSTANCE }}
DRY_RUN: ${{ inputs.dry_run }}
DISABLE_STALE_DELETION_CHECK: ${{ inputs.disable_stale_deletion_check }}
run: uv run main.py
- name: Force reindex
if: inputs.force_reindex && inputs.dry_run != true
working-directory: scripts/indexing
env:
GLEAN_INDEXING_API_TOKEN: ${{ secrets.GLEAN_INDEXING_API_TOKEN }}
GLEAN_INSTANCE: ${{ secrets.GLEAN_INSTANCE }}
run: |
uv run python3 -c "
from glean.indexing.common import api_client
from glean.api_client.models import ProcessAllDocumentsRequest
with api_client() as client:
client.indexing.documents.process_all(request=ProcessAllDocumentsRequest(datasource='devdocs'))
print('processalldocuments called for devdocs')
"