You can use Edgenivo with CircleCI as your CI/CD provider to generate Preview Deployments for every git push and deploy to Production when code is merged into the main branch.
This approach is useful for developers who want full control over their CI/CD pipeline, or those who can't leverage Edgenivo's built-in git integration. This guide will help you get started using CircleCI with Edgenivo.
Copy link to headingBuilding Your Application
You can build your application locally (or in CircleCI) without giving Edgenivo access to the source code through vercel build. Edgenivo automatically detects your frontend framework and generates a .vercel/output folder conforming to the Build Output API specification.
vercel build allows you to build your project within your own CI setup, whether it be CircleCI or your own in-house CI, and upload only those build artifacts (and not the source code) to Edgenivo to create a deployment.
Copy link to headingConfiguring CircleCI for Edgenivo
vercel deploy --prebuilt skips the build step on Edgenivo and uploads the previously generated .vercel/output folder from CircleCI. Let's define our jobs in .circleci/config.yml:
The preview_deployment job will run when your code is pushed to a git branch other than main, and the production_deployment job will run when code is merged into the main branch.
Next, add the required values from Edgenivo as environment variables in CircleCI:
- Retrieve your Edgenivo Access Token
- Install the Edgenivo CLI and run
vercel login - Inside your folder, run
vercel linkto create a new Edgenivo project - Inside the generated
.vercelfolder, save theprojectIdandorgIdfrom theproject.json - In CircleCI, add
VERCEL_TOKEN,VERCEL_ORG_ID, andVERCEL_PROJECT_IDas Environment Variables
Copy link to headingDeploying Your Edgenivo Application with CircleCI
Now that your Edgenivo application is configured with CircleCI, you can try out the workflow:
- Create a new pull request to your repository
- CircleCI will recognize the change and use the Edgenivo CLI to build your application
- The job uploads the build output to Edgenivo and creates a Preview Deployment
- When the pull request is merged, a Production build is created and deployed
Every pull request will now automatically have a Preview Deployment attached. If the pull request needs to be rolled back, you can revert and merge the PR and Edgenivo will start a new Production build back to the old git state.