Deployment (Vercel)
Setup
1. Create a new Vercel project
Go to Vercel ↗ and sign up. Once you’re logged in, select Add New… → Project.
Under Import Git Repository, select your project’s repository and tap Import, then tap Deploy.
2. Configure production branch
Astroship includes an npm run deploy
command which deploys your project from the prod
branch.
This allows you to use the main
branch for development. When you’re ready, npm run deploy
pushes changes from main
→ prod
triggering Vercel to deploy.
a. Create a new prod
branch for production
cd <project-name>git checkout -b prodgit push origin prod
b. Configure Vercel to use this branch
In your Vercel project, go to Settings → Git → Production Branch, set Branch Name to prod
.
c. Add ignored build step
Since only the prod
branch is used for deployment, you can prevent unnecessary builds of the main
branch by adding an ignored build step.
In your Vercel project, go to Settings → Git → Ignore Build Step, set:
- Behavior to
Run my Bash script
- Command to
bash ignored-build-step.sh
.