File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,20 @@ inputs:
1414 required : true
1515 vercel_token :
1616 required : true
17+ custom_domain :
18+ description : " Custom domain in the format {locale}-{pr}.nextjs.im (optional)"
19+ required : false
20+ default : " "
1721outputs :
1822 inspect_url :
1923 description : " Vercel inspect URL"
2024 value : ${{ steps.vercel_deploy.outputs.inspect_url }}
2125 prod_url :
2226 description : " Vercel preview/production URL"
2327 value : ${{ steps.vercel_deploy.outputs.prod_url }}
28+ custom_domain_url :
29+ description : " Custom domain URL if set"
30+ value : ${{ steps.set_custom_domain.outputs.custom_domain_url }}
2431runs :
2532 using : " composite"
2633 steps :
5663 VERCEL_PROJECT_ID : ${{ inputs.vercel_project_id }}
5764 VERCEL_ORG_ID : ${{ inputs.vercel_org_id }}
5865 shell : bash
66+ - name : Set Custom Domain (if provided)
67+ id : set_custom_domain
68+ if : ${{ inputs.custom_domain != '' }}
69+ run : |
70+ deployment_url=${{ steps.vercel_deploy.outputs.prod_url }}
71+ custom_domain="${{ inputs.custom_domain }}"
72+ npx vercel alias set "$deployment_url" "$custom_domain" --token=${{ inputs.vercel_token }}
73+ echo "custom_domain_url=https://$custom_domain" >> $GITHUB_OUTPUT
74+ env :
75+ VERCEL_PROJECT_ID : ${{ inputs.vercel_project_id }}
76+ VERCEL_ORG_ID : ${{ inputs.vercel_org_id }}
77+ shell : bash
Original file line number Diff line number Diff line change 6868 vercel_project_id : ${{ secrets[matrix.secret_project_id] }}
6969 vercel_org_id : ${{ secrets.VERCEL_ORG_ID }}
7070 vercel_token : ${{ secrets.VERCEL_TOKEN }}
71+ custom_domain : ${{ matrix.locale }}-${{ github.event.pull_request.number }}.nextjs.im
7172 - name : Comment PR with Vercel Preview Links (${{ matrix.locale }})
7273 if : steps.should_deploy.outputs.should_deploy == 'true'
7374 uses : ./.github/actions/comment-vercel-preview
You can’t perform that action at this time.
0 commit comments