File tree Expand file tree Collapse file tree 4 files changed +76
-26
lines changed Expand file tree Collapse file tree 4 files changed +76
-26
lines changed Original file line number Diff line number Diff line change 1+ name : " Vercel Build"
2+ description : " Build project artifacts using Vercel CLI for deployment."
3+ inputs :
4+ environment :
5+ description : " Vercel environment (production or preview)"
6+ required : true
7+ prodFlag :
8+ description : " Set to --prod for production deploys, empty for preview"
9+ required : false
10+ default : " "
11+ vercel_project_id :
12+ required : true
13+ vercel_org_id :
14+ required : true
15+ vercel_token :
16+ required : true
17+ runs :
18+ using : " composite"
19+ steps :
20+ - name : Pull Vercel Environment Information
21+ run : npx vercel pull --yes --environment=${{ inputs.environment }} --token=${{ inputs.vercel_token }}
22+ env :
23+ VERCEL_PROJECT_ID : ${{ inputs.vercel_project_id }}
24+ VERCEL_ORG_ID : ${{ inputs.vercel_org_id }}
25+ shell : bash
26+ - name : Echo Vercel Environment File
27+ run : |
28+ ls -l .vercel/.env*
29+ for f in .vercel/.env*; do
30+ echo "\n----- $f -----"
31+ cat "$f"
32+ done
33+ shell : bash
34+ - name : Build Project Artifacts
35+ run : npx vercel build ${{ inputs.prodFlag }} --token=${{ inputs.vercel_token }}
36+ env :
37+ VERCEL_PROJECT_ID : ${{ inputs.vercel_project_id }}
38+ VERCEL_ORG_ID : ${{ inputs.vercel_org_id }}
39+ shell : bash
Original file line number Diff line number Diff line change @@ -24,26 +24,14 @@ outputs:
2424runs :
2525 using : " composite"
2626 steps :
27- - name : Pull Vercel Environment Information
28- run : npx vercel pull --yes --environment=${{ inputs.environment }} --token=${{ inputs.vercel_token }}
29- env :
30- VERCEL_PROJECT_ID : ${{ inputs.vercel_project_id }}
31- VERCEL_ORG_ID : ${{ inputs.vercel_org_id }}
32- shell : bash
33- - name : Echo Vercel Environment File
34- run : |
35- ls -l .vercel/.env*
36- for f in .vercel/.env*; do
37- echo "\n----- $f -----"
38- cat "$f"
39- done
40- shell : bash
41- - name : Build Project Artifacts
42- run : npx vercel build ${{ inputs.prodFlag }} --token=${{ inputs.vercel_token }}
43- env :
44- VERCEL_PROJECT_ID : ${{ inputs.vercel_project_id }}
45- VERCEL_ORG_ID : ${{ inputs.vercel_org_id }}
46- shell : bash
27+ - name : Build with Vercel
28+ uses : ./.github/actions/vercel-build
29+ with :
30+ environment : ${{ inputs.environment }}
31+ prodFlag : ${{ inputs.prodFlag }}
32+ vercel_project_id : ${{ inputs.vercel_project_id }}
33+ vercel_org_id : ${{ inputs.vercel_org_id }}
34+ vercel_token : ${{ inputs.vercel_token }}
4735 - name : Deploy Project Artifacts
4836 id : vercel_deploy
4937 run : |
Original file line number Diff line number Diff line change 11name : Prerelease
22
33on :
4- workflow_dispatch :
54 pull_request :
65 types :
76 - opened
87 - labeled
98 - synchronize
9+ branches-ignore :
10+ - docs/update-translations
11+ - docs/sync-nextjs-documentation
1012
1113permissions :
1214 pull-requests : write
1315 issues : write
1416
1517jobs :
1618 deploy :
19+ if : |
20+ github.event_name == 'pull_request' &&
21+ contains(github.event.pull_request.labels.*.name, 'prerelease')
1722 runs-on : ubuntu-latest
1823 strategy :
1924 matrix :
9499 needs : deploy
95100 name : Comment Vercel Previews
96101 runs-on : ubuntu-latest
97- if : always()
98102 steps :
99103 - name : Checkout repo
100104 uses : actions/checkout@v3
Original file line number Diff line number Diff line change 77 - docs/sync-nextjs-documentation
88
99jobs :
10- translate :
10+ deploy-and-update-index :
1111 runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ include :
15+ - locale : en
16+ secret_project_id : VERCEL_PROJECT_EN_ID
17+ orama_private_api_key : ORAMA_PRIVATE_API_KEY_EN
18+ - locale : zh-hans
19+ secret_project_id : VERCEL_PROJECT_ZH_HANS_ID
20+ orama_private_api_key : ORAMA_PRIVATE_API_KEY_ZH_HANS
21+ - locale : zh-hant
22+ secret_project_id : VERCEL_PROJECT_ZH_HANT_ID
23+ orama_private_api_key : ORAMA_PRIVATE_API_KEY_ZH_HANT
24+ name : Build ${{ matrix.locale }}
1225 steps :
13- # Checkout the repository first to access local actions
1426 - name : Checkout code
1527 uses : actions/checkout@v3
1628 with :
1729 fetch-depth : 1
1830 - name : Setup Tools
19- # After pnpm install, apps/docs will execute postinstall: fumadocs-mdx
20- # Which will generated MDX types (check if the docs frontmatter is correct)
2131 uses : ./.github/actions/setup
32+ - name : Build ${{ matrix.locale }}
33+ id : deploy
34+ uses : ./.github/actions/vercel-build
35+ with :
36+ environment : production
37+ prodFlag : --prod
38+ vercel_project_id : ${{ secrets[matrix.secret_project_id] }}
39+ vercel_org_id : ${{ secrets.VERCEL_ORG_ID }}
40+ vercel_token : ${{ secrets.VERCEL_TOKEN }}
You can’t perform that action at this time.
0 commit comments