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 1616 VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_EN_ID }}
1717 VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
1818 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 }}
1928
2029 deploy-zh-hans :
2130 uses : ./.github/workflows/vercel-deploy.yml
2635 VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ZH_HANS_ID }}
2736 VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
2837 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 11name : Update Search Index
22
33on :
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
1315
1416jobs :
1517 update-search-index :
1618 runs-on : ubuntu-latest
1719 steps :
18- # Checkout the repository first to access local actions
1920 - name : Checkout code
2021 uses : actions/checkout@v3
2122 with :
2223 fetch-depth : 1
2324 - name : Setup Tools
2425 uses : ./.github/actions/setup
2526
26- - name : Build docs/zh-hans
27+ - name : Build docs
2728 shell : bash
2829 run : pnpm build:docs
2930 env :
30- LOCALE : " zh-hans "
31+ LOCALE : " ${{ inputs.locale }} "
3132 GEN_ORAMA_STATIC : " true"
32- MDX_ASYNC : " false "
33+ MDX_ASYNC : " true "
3334 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 }}
4135
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
5137 shell : bash
5238 run : pnpm run update-search-index
5339 env :
54- LOCALE : " en "
40+ LOCALE : " ${{ inputs.locale }} "
5541 ORAMA_PRIVATE_API_KEY_EN : ${{ secrets.ORAMA_PRIVATE_API_KEY_EN }}
5642 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