First, you have to create a free account on Vercel
Install the tool
You probably need to configure your shell for npm with
PATH="$PATH:$HOME/.npm/bin"
export npm_config_prefix="$HOME/.npm"
After that, just install vercel globally
npm i -g vercel@latest
Login to your account
vercel login
Short configurations
vercel telemetry status
vercel telemetry disable
Deploy a new project from a directory
For a single repo with one project.
cd lolthway
vercel
You will have some question/answer:
> Create a new project
> Name? lolthway
> Connect this Git repository to automatically deploy changes on every push? y
> Detected Astro (dist)
> Customize settings? N
After all that, your project should be deployed at the address https://lolthway.vercel.app
Add environment variable
vercel env ls
vercel env add SITE_URL
And write the value you want e.g: https://lolthway.vercel.app/
Link your project to a Git(hub) repository
vercel link
Like this, every commit will trigger a new deployment to Vercel.
Deploy
See if all is ok with:
vercel deploy
And if no error:
vercel deploy --prod
Manage other projects
vercel project ls
vercel project add
vercel project rm
vercel project inspect [project-name]
Logout
vercel logout