deploy-to-vercel-action
deploy-to-vercel-action copied to clipboard
Vercel Deploy hangs on the step when using Alias Domain and PR Preview Domain
ALIAS_DOMAINS, PR_PREVIEW_DOMAIN
Verified that if I use "ALIAS_DOMAINS" it causes the hang up during "Assigning custom domains to Vercel deployment"
PR_PREVIEW_DOMAIN seems to be fine but doesn't do anything without ALIAS_DOMAINS it seems so it does not hang.

steps: - name: Deply to Vercel id: DeployVercelAction uses: BetaHuhn/[email protected] with: VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Required GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} #Optional VERCEL_ORG_ID: ${{ secrets.ORG_ID}} #Required VERCEL_PROJECT_ID: ${{ secrets.PROJECT_ID}} #Required PRODUCTION: false GITHUB_DEPLOYMENT_ENV: Preview ALIAS_DOMAINS: | jung.vercel.app {BRANCH}-jung.vercel.app PR_PREVIEW_DOMAIN: "{BRANCH}-jung.vercel.app"
More information to fix this. Looks like its Vercel Prompt thats causing this.

Solution:
Add to deploy action
with:
VERCEL_SCOPE: 'your-team-slug'
Explanation:
The problem is that the deploy-to-vercel-action by default uses the default Vercel account, not the team. In your case jkim-mjhassoccom. However to deploy a custom domain vercel cli requires credentials of the team the default account is member of.
I was trying to extend VERCEL_TOKEN scope to All non-SAML Teams and it successfully authorised but failed in the next step of assigning the domain.
Setting up VERCEL_SCOPE: 'your-team-slug' fixed the problem. Then vercel cli makes sure that the cli will act with team credentials. The team that can assign custom domains.
your-team-slug can be found here: https://vercel.com/teams/{YOUR_TEAM_SLUG}/settings
The good practice is also to reduce the VERCEL_TOKEN scope just to the specified team according to the least privilege principle.
I've created a PR describing it in docs: https://github.com/BetaHuhn/deploy-to-vercel-action/pull/197
Nice, I also had this issue and confirmed that adding VERCEL_SCOPE fixed it!