I'm trying to get Vercel to work with our CircleCI pipeline (we want to run tests beforehand). We WANT to have 2 environments:
- stagging - on commits to
main
we want to have the changing reflected on our staging env - prod - on commits to
prod
we want to update our prod env
Ideally, these deployments should be triggered by our CircleCI pipeline only.
Is this possible to do with Vercel CLI? We want to have a custom domain for our staging env (e.g. myApp-staging.vercel.app
). I saw there was a tutorial on how to setup Vercel with Github Actions, but it doesn't really go into setting up staging and prod.
I know there is the concept of preview environments in Vercel. That feels slightly off to me, however... We want to have only 1 prod env and only 1 staging env.
Here's the code I've got so far:
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}