File tree Expand file tree Collapse file tree 2 files changed +34
-30
lines changed Expand file tree Collapse file tree 2 files changed +34
-30
lines changed Original file line number Diff line number Diff line change 16
16
VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_EN_ID }}
17
17
VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
18
18
VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
19
+
20
+ update-search-index-en :
21
+ needs : deploy-en
22
+ uses : ./.github/workflows/update-search-index.yml
23
+ with :
24
+ locale : en
25
+ secrets :
26
+ ORAMA_PRIVATE_API_KEY_EN : ${{ secrets.ORAMA_PRIVATE_API_KEY_EN }}
27
+ ORAMA_PRIVATE_API_KEY_ZH_HANS : ${{ secrets.ORAMA_PRIVATE_API_KEY_ZH_HANS }}
19
28
20
29
deploy-zh-hans :
21
30
uses : ./.github/workflows/vercel-deploy.yml
26
35
VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ZH_HANS_ID }}
27
36
VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
28
37
VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
38
+
39
+ update-search-index-zh-hans :
40
+ needs : deploy-zh-hans
41
+ uses : ./.github/workflows/update-search-index.yml
42
+ with :
43
+ locale : zh-hans
44
+ secrets :
45
+ ORAMA_PRIVATE_API_KEY_EN : ${{ secrets.ORAMA_PRIVATE_API_KEY_EN }}
46
+ ORAMA_PRIVATE_API_KEY_ZH_HANS : ${{ secrets.ORAMA_PRIVATE_API_KEY_ZH_HANS }}
Original file line number Diff line number Diff line change 1
1
name : Update Search Index
2
2
3
3
on :
4
- push :
5
- # Run when merging from official repo to check if translations are outdated
6
- branches :
7
- - main
8
- workflow_dispatch : # Allow manual triggering
9
-
10
- # Add permissions needed for creating PRs
11
- permissions :
12
- contents : write
4
+ workflow_call :
5
+ inputs :
6
+ locale :
7
+ description : " Locale to update (e.g., 'en' or 'zh-hans')"
8
+ required : true
9
+ type : string
10
+ secrets :
11
+ ORAMA_PRIVATE_API_KEY_EN :
12
+ required : true
13
+ ORAMA_PRIVATE_API_KEY_ZH_HANS :
14
+ required : true
13
15
14
16
jobs :
15
17
update-search-index :
16
18
runs-on : ubuntu-latest
17
19
steps :
18
- # Checkout the repository first to access local actions
19
20
- name : Checkout code
20
21
uses : actions/checkout@v3
21
22
with :
22
23
fetch-depth : 1
23
24
- name : Setup Tools
24
25
uses : ./.github/actions/setup
25
26
26
- - name : Build docs/zh-hans
27
+ - name : Build docs
27
28
shell : bash
28
29
run : pnpm build:docs
29
30
env :
30
- LOCALE : " zh-hans "
31
+ LOCALE : " ${{ inputs.locale }} "
31
32
GEN_ORAMA_STATIC : " true"
32
- MDX_ASYNC : " false "
33
+ MDX_ASYNC : " true "
33
34
NODE_OPTIONS : " --max-old-space-size=8192"
34
- - name : Update Search Index (zh-hans)
35
- shell : bash
36
- run : pnpm run update-search-index
37
- env :
38
- LOCALE : " zh-hans"
39
- ORAMA_PRIVATE_API_KEY_EN : ${{ secrets.ORAMA_PRIVATE_API_KEY_EN }}
40
- ORAMA_PRIVATE_API_KEY_ZH_HANS : ${{ secrets.ORAMA_PRIVATE_API_KEY_ZH_HANS }}
41
35
42
- - name : Build docs/en
43
- shell : bash
44
- run : pnpm build:docs
45
- env :
46
- LOCALE : " en"
47
- GEN_ORAMA_STATIC : " true"
48
- MDX_ASYNC : " false"
49
- NODE_OPTIONS : " --max-old-space-size=8192"
50
- - name : Update Search Index (en)
36
+ - name : Update Search Index
51
37
shell : bash
52
38
run : pnpm run update-search-index
53
39
env :
54
- LOCALE : " en "
40
+ LOCALE : " ${{ inputs.locale }} "
55
41
ORAMA_PRIVATE_API_KEY_EN : ${{ secrets.ORAMA_PRIVATE_API_KEY_EN }}
56
42
ORAMA_PRIVATE_API_KEY_ZH_HANS : ${{ secrets.ORAMA_PRIVATE_API_KEY_ZH_HANS }}
You can’t perform that action at this time.
0 commit comments