Linking project to Vercel
If you haven’t already, install the Vercel CLI:
npm i -g vercel@latestThen once that is done, go to the project root in your terminal and run
vercel linkFollow the instructions, make sure the name of the project is correct, most of the choices should be fine with default values.
After this, you can deploy the first version to Vercel.
vercel deployPsst! Make sure the environment variables are set in Vercel aswell
Connecting Vercel to Github
We of course prefer not to do manual deploys from our terminals, so what we want to do is to go into Vercel to the project and connect our Git repo for automated deployments. Open the project, go to Settings and then Git in the menu. Follow the steps for authorization and connecting the repository.
Once this is done, any pushes to the repository will result in a deploy for that branch. Pushes to the main branch will trigger “production” deployments, all other branches will be “preview” deployments, which get their own unique URL. Vercel also provides a URL for the specific commit of the deployment.