Set up CircleCI to automatically build and deploy your Bolt.new project on every GitHub push. Export your Bolt project to a GitHub repository, add a .circleci/config.yml pipeline that runs npm run build and deploys to Netlify or Vercel, and configure environment variables in CircleCI's project settings. CircleCI's free tier offers 6,000 build minutes per month — enough for most Bolt prototypes.
Automated CI/CD for Bolt.new Projects with CircleCI
Bolt.new's publish button is great for quick deployments during development, but production applications eventually need a proper CI/CD pipeline — automated builds on every commit, test runs before deployment, and consistent deployment processes that do not depend on a developer manually clicking a button. CircleCI fills this role for Bolt-generated projects by connecting to the GitHub repository that Bolt pushes to.
The architecture is straightforward: Bolt.new acts as your AI-assisted development environment, GitHub acts as the source of truth for your code, and CircleCI acts as the automation layer. When you finish a feature in Bolt and push to GitHub (using Bolt's built-in Git panel), CircleCI automatically detects the new commit, spins up a build environment, installs dependencies, runs your build command, and deploys the output to whatever hosting platform you configure. The entire process typically takes 2-4 minutes for a Bolt Vite project and 3-6 minutes for a Next.js project.
CircleCI's configuration lives in a .circleci/config.yml file at the root of your repository. You can either add this file manually to your Bolt project (by creating it in the file editor) or add it after exporting to GitHub using GitHub's web interface. Once the config file is committed to the repository, CircleCI picks it up automatically. The free tier provides 6,000 build minutes per month on shared infrastructure — for a Bolt project that builds in under 5 minutes, this means approximately 1,200 free deployments per month.
Integration method
CircleCI has no direct connection to Bolt.new — the integration works through GitHub as an intermediary. You push your Bolt project to a GitHub repository using Bolt's built-in Git panel, then connect that repository to CircleCI. Every subsequent push from Bolt (or from teammates working locally) triggers a CircleCI pipeline that builds the project and deploys it to your chosen hosting platform. CircleCI handles the build infrastructure so Netlify or Vercel receive pre-built artifacts rather than running builds themselves.
Prerequisites
- A Bolt.new account with an active project connected to GitHub (use Bolt's Git panel to push to a GitHub repository first)
- A GitHub account with the Bolt project repository accessible
- A CircleCI account (free at circleci.com — sign up with GitHub for automatic repository access)
- A Netlify account (free at netlify.com) or Vercel account for the deployment target, with an API token for automated deployments
- Node.js 18 or later knowledge is helpful but not required — the pipeline config handles the runtime version
Step-by-step guide
Push Your Bolt Project to GitHub
Push Your Bolt Project to GitHub
Before CircleCI can automate anything, your Bolt project needs to live in a GitHub repository. CircleCI connects to GitHub (and GitLab/Bitbucket) to monitor for new commits. If your Bolt project is not yet on GitHub, this step sets that up. In your Bolt project, look for the Git panel icon in the left sidebar (it looks like a branching tree diagram). If you have not connected GitHub yet, click 'Connect GitHub' and authorize Bolt through GitHub's OAuth flow. Once connected, click 'Push to GitHub' and choose 'Create new repository.' Give the repository a meaningful name — something like 'my-bolt-app' — and choose public or private based on your preference. Click 'Create and push' and Bolt will commit all your project files to the new repository. For the CircleCI pipeline to work correctly, your repository needs to have the standard Bolt project structure: a package.json with a build script ('npm run build' for both Vite and Next.js), the src/ directory with your components, and any configuration files (vite.config.ts, next.config.js, tailwind.config.js). Bolt generates all of these automatically. Note on the GitHub-CircleCI-Netlify flow: Bolt does not communicate with CircleCI directly. The integration is: Bolt pushes code to GitHub → GitHub notifies CircleCI via webhook → CircleCI runs the pipeline → CircleCI deploys to Netlify/Vercel. Each step is independent. If you later want to bypass CircleCI for a quick deploy (e.g., during development), you can still use Bolt's publish button directly to Bolt Cloud or Netlify — the CircleCI pipeline only runs when commits reach GitHub.
1# Verify your repository has the expected structure before adding CircleCI:2ls -la3# Should see:4# package.json5# src/6# public/7# vite.config.ts (or next.config.js)8# .gitignore9# tsconfig.json1011# Check that the build script exists:12cat package.json | grep -A5 '"scripts"'Pro tip: Make sure your .gitignore file (created by Bolt automatically) excludes node_modules/, dist/, and .next/ before pushing. CircleCI installs dependencies fresh on every build, so node_modules in the repository would waste storage and slow down git operations.
Expected result: Your Bolt project appears as a GitHub repository with all source files. The repository contains package.json, src/, and configuration files but not node_modules/ or dist/.
Connect the Repository to CircleCI
Connect the Repository to CircleCI
After setting up the GitHub repository, the next step is connecting it to CircleCI so the platform monitors for new commits. Go to circleci.com and sign in with your GitHub account. CircleCI uses GitHub OAuth, so it automatically detects repositories you have access to. On the CircleCI dashboard, click 'Projects' in the left sidebar, then click 'Set Up Project' next to the repository that contains your Bolt project. CircleCI will ask how you want to configure the pipeline — choose 'Create my own config' or 'Use an existing config' if you plan to add the config file manually. CircleCI will offer to create a default config.yml. You can let it generate a starter configuration and then customize it, or skip this and add the config file directly to your GitHub repository in the next step. Either approach results in the same outcome — a .circleci/config.yml file in the repository root that defines the pipeline. An important note about CircleCI's free tier: as of 2026, the free tier (called the 'Free' plan) provides 6,000 build credits per month on Linux infrastructure. Build credit consumption depends on resource class — using the 'small' resource class (1 vCPU, 2GB RAM) consumes 5 credits per minute. A 4-minute Bolt Vite build uses 20 credits. With 6,000 credits per month, you can run approximately 300 builds per month on the free tier. This is generous for development and staging workflows; production pipelines with high commit frequency may require upgrading to the paid plan.
Pro tip: When connecting CircleCI to a GitHub organization repository (as opposed to a personal repository), ensure CircleCI has been granted access to the organization. Go to GitHub Settings > Applications > Authorized OAuth Apps and verify CircleCI appears with organization access.
Expected result: The GitHub repository appears in CircleCI's Projects list. CircleCI is now watching the repository for new commits and will trigger a pipeline when the config file is added.
Create the .circleci/config.yml Pipeline
Create the .circleci/config.yml Pipeline
The pipeline configuration file tells CircleCI what to do when new code is pushed. For a Bolt.new project, the pipeline has three main jobs: install dependencies, build the project, and deploy the output. The configuration format is YAML and lives in a .circleci/ directory at your repository root. You can create this file in two ways: add it directly in the Bolt editor (create a new file at .circleci/config.yml in Bolt's file tree), or add it through GitHub's web interface after pushing the project. Either approach works — the file just needs to be committed to the repository. The configuration below works for both Vite and Next.js Bolt projects. It uses Node.js 18, caches node_modules between builds for faster runs (saving approximately 30-60 seconds per build), runs npm run build, and deploys to Netlify. Adjust the deploy step if you are using Vercel or another platform. Key configuration decisions: Using the 'small' resource class keeps the build within the free tier's budget. The node_modules cache uses a checksum of package-lock.json as the cache key — whenever you add or remove packages in Bolt (which updates package-lock.json), CircleCI automatically invalidates the cache and does a fresh install. The deploy job depends on the build job completing successfully, so a failed build prevents deployment. The `only: main` filter under branches means the pipeline only runs on pushes to the main branch — which is where Bolt always pushes. If you set up feature branches for manual work, those branches will not trigger deployments (only build verification). This is typically the desired behavior for production deployments.
1# .circleci/config.yml2version: 2.134orbs:5 node: circleci/node@5.2.067jobs:8 build:9 docker:10 - image: cimg/node:18.1711 resource_class: small12 steps:13 - checkout14 - node/install-packages:15 pkg-manager: npm16 cache-path: node_modules17 override-ci-command: npm ci18 - run:19 name: Build project20 command: npm run build21 - persist_to_workspace:22 root: .23 paths:24 - dist # Vite output directory25 # - .next # Uncomment for Next.js projects2627 deploy-netlify:28 docker:29 - image: cimg/node:18.1730 resource_class: small31 steps:32 - attach_workspace:33 at: .34 - run:35 name: Install Netlify CLI36 command: npm install -g netlify-cli37 - run:38 name: Deploy to Netlify39 command: |40 netlify deploy \41 --dir=dist \42 --site=$NETLIFY_SITE_ID \43 --auth=$NETLIFY_AUTH_TOKEN \44 --prod4546workflows:47 build-and-deploy:48 jobs:49 - build:50 filters:51 branches:52 only: main53 - deploy-netlify:54 requires:55 - build56 filters:57 branches:58 only: mainPro tip: For Next.js Bolt projects, change the persist_to_workspace paths from 'dist' to '.next' and 'public', and update the Netlify deploy command dir flag from '--dir=dist' to '--dir=.next'. Also ensure your Netlify site is configured for Next.js if using server-side rendering.
Expected result: The .circleci/config.yml file is committed to the repository. CircleCI detects the new file and triggers a pipeline run. The first run may fail because the Netlify environment variables are not yet configured — this is expected.
Configure Environment Variables in CircleCI
Configure Environment Variables in CircleCI
Your CircleCI pipeline needs credentials to deploy to Netlify — specifically the Netlify auth token and site ID. These must be stored as CircleCI environment variables, not hardcoded in the config.yml file (which would expose them in your GitHub repository). To get your Netlify auth token: log in to Netlify, go to User Settings > Applications > Personal access tokens, click 'New access token,' give it a name like 'CircleCI Deploy,' and copy the generated token. You will not be able to see it again after closing the dialog. To get your Netlify site ID: if you have not deployed to Netlify yet, create a new site first (either a blank site from the Netlify dashboard or a quick manual deploy). Then go to the site's Settings > General > Site details and copy the 'Site ID' value (a UUID like 'abc12345-1234-1234-1234-abcdefabcdef'). To add these to CircleCI: in the CircleCI dashboard, go to your project's settings (click the gear icon next to the project name), then select 'Environment Variables' in the left sidebar. Click 'Add Variable' and add: NETLIFY_AUTH_TOKEN with the token value, and NETLIFY_SITE_ID with the site ID value. CircleCI encrypts these values and makes them available to pipeline runs as standard environment variables. If your Bolt project also uses API keys (for Supabase, OpenAI, or other services), add those here as well — these values will be available during the build and baked into the output for client-side variables, or available to the Netlify deployment for server-side variables. For client-side Vite variables (VITE_ prefix), they need to be present during the build step so Vite can inline them.
1# Environment variables to add in CircleCI project settings:2# NETLIFY_AUTH_TOKEN = your-netlify-personal-access-token3# NETLIFY_SITE_ID = your-netlify-site-id-uuid4#5# For Bolt projects with Supabase:6# VITE_SUPABASE_URL = https://yourproject.supabase.co7# VITE_SUPABASE_ANON_KEY = your-anon-key8#9# For Bolt projects with Next.js API routes:10# Any server-side env vars that need to be set at build timePro tip: Use CircleCI's 'Context' feature (Organization Settings > Contexts) if you share environment variables across multiple projects. Create a context called 'netlify-deploy' with the Netlify credentials, then reference it in all pipelines — this avoids duplicating the same variables in every project's settings.
Expected result: CircleCI shows NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID (and any other required variables) in the project's Environment Variables list. The next pipeline run triggered by a Bolt push should complete all jobs successfully.
Verify the Pipeline and Connect the Bolt-CircleCI-Netlify Flow
Verify the Pipeline and Connect the Bolt-CircleCI-Netlify Flow
With everything configured, test the complete pipeline by making a change in Bolt and pushing to GitHub. This verifies that the entire automation chain works end to end. In Bolt, make a visible change — update some text on the homepage, change a button color, or add a new component. Then use Bolt's Git panel to push to GitHub. The push should take 10-30 seconds. Once it completes, go to your CircleCI dashboard and watch the pipeline trigger automatically. The build job starts within 30-60 seconds of the GitHub push. Monitor the pipeline progress in CircleCI. You will see each step execute: 'Checkout code,' 'Restore cache,' 'Install packages,' 'Build project,' and then in the deploy job, 'Deploy to Netlify.' Each step shows its output and duration. If any step fails, the logs will show the exact error — this is particularly useful for catching build errors that were not visible in Bolt's preview. A key insight about this workflow: Bolt's WebContainer runs Node.js in a browser environment with some differences from a standard Node.js build environment. CircleCI runs a true Linux Node.js environment, which means it may catch build errors that Bolt's preview missed. TypeScript strict mode errors, missing dependencies, and environment-specific issues all surface in the CircleCI build. This is actually a feature — catching issues before they reach production is the core purpose of CI. Once the pipeline completes successfully, the deployed Netlify URL will have your latest Bolt changes live. From this point on, every push from Bolt automatically triggers a new deployment through CircleCI. You can monitor deployment history, re-run failed builds, and view build logs from the CircleCI dashboard without needing to open Bolt at all.
1# Check CircleCI pipeline status via CLI (optional):2npm install -g @circleci/circleci-cli3circleci setup # authenticate with your API token4circleci pipeline list # view recent pipelines56# Or use the CircleCI web dashboard at:7# https://app.circleci.com/pipelines/github/YOUR_USERNAME/YOUR_REPOPro tip: Enable CircleCI's GitHub Status Checks integration (CircleCI Project Settings > Advanced Settings > GitHub Status Updates). This shows a green checkmark or red X on each GitHub commit, giving you immediate visibility into whether a Bolt push built and deployed successfully.
Expected result: A push from Bolt triggers a CircleCI pipeline that builds the project and deploys to Netlify. The live Netlify URL shows the updated content within 5 minutes of the Bolt push. Future Bolt pushes automatically trigger new pipeline runs.
Common use cases
Automated Deployment Pipeline for a Bolt Prototype
Set up a pipeline where every push from Bolt to GitHub automatically builds the project and deploys it to Netlify. The team always has a live URL with the latest code, without anyone manually clicking deploy buttons. Bolt's publish button is replaced by a more reliable, auditable CI process.
Copy this prompt to try it in Bolt.new
Build Verification Before Deployment
Catch build errors before they reach production by running npm run build in CircleCI on every push. If a Bolt-generated change breaks the build (missing imports, TypeScript errors, etc.), CircleCI fails the pipeline and sends an email notification, preventing the broken code from being deployed.
Copy this prompt to try it in Bolt.new
Multi-Environment Deployment from Bolt
Configure CircleCI to deploy to a staging environment on every push to the main branch and to production only on tagged releases. Bolt always pushes to main, which updates staging automatically. Production releases require an explicit git tag, giving you control over what reaches users.
Copy this prompt to try it in Bolt.new
Troubleshooting
CircleCI pipeline fails with 'npm ci: command not found' or 'npm run build: command not found'
Cause: The Docker image specified in the config.yml does not have Node.js installed, or the wrong image tag is being used.
Solution: Ensure the Docker image is 'cimg/node:18.17' or another CircleCI convenience image with Node.js. Do not use plain ubuntu or debian images without additional Node.js installation steps. The 'cimg/node:' prefix indicates CircleCI's pre-built images that have Node.js, npm, and common tools installed.
1# Correct Docker image in .circleci/config.yml:2# docker:3# - image: cimg/node:18.174#5# NOT:6# docker:7# - image: ubuntu:22.04 # Missing Node.jsNetlify deploy step fails with 'Not logged in' or 'Site not found'
Cause: The NETLIFY_AUTH_TOKEN or NETLIFY_SITE_ID environment variables are not set in CircleCI project settings, or the Netlify token was created for a different account than the one that owns the site.
Solution: Verify both variables are set in CircleCI > Project Settings > Environment Variables. Confirm the NETLIFY_AUTH_TOKEN is from your personal access tokens (not a team token) and that the NETLIFY_SITE_ID UUID matches exactly — copy it directly from Netlify Site Settings > Site Details > Site ID rather than typing it manually.
1# Temporarily add this to your CircleCI config to debug missing env vars:2# - run:3# name: Debug environment4# command: |5# echo "Netlify token length: ${#NETLIFY_AUTH_TOKEN}"6# echo "Site ID: $NETLIFY_SITE_ID"7# Remove after debugging - this prints the site ID to logsBuild succeeds in CircleCI but the deployed Netlify app is missing environment variables and API calls fail
Cause: Vite embeds VITE_* variables at build time — they must be present as CircleCI environment variables during the build step, not just in the local .env file. The .env file in the repository is not read by CircleCI automatically.
Solution: Add all VITE_* variables needed by your Bolt app to CircleCI's project environment variables. These are made available during the npm run build step and Vite inlines them into the production bundle. For Next.js NEXT_PUBLIC_* variables, the same principle applies. Server-side variables (without VITE_ or NEXT_PUBLIC_ prefix) should be added as Netlify environment variables instead, since they are only needed at runtime.
1# Add to CircleCI project environment variables:2# VITE_SUPABASE_URL = https://yourproject.supabase.co3# VITE_SUPABASE_ANON_KEY = your-anon-key4# VITE_ANY_OTHER_PUBLIC_VAR = value5#6# These are read by Vite during 'npm run build' in the CircleCI environmentBest practices
- Use CircleCI's node_modules caching with a package-lock.json checksum as the cache key — this saves 1-3 minutes on most builds by skipping dependency installation when nothing changed.
- Store all deployment tokens and API keys as CircleCI environment variables rather than in the config.yml file or the GitHub repository — the config.yml is committed to your public (or accessible) repository.
- Add a lint step before the build step to catch code quality issues early: npm run lint in the CircleCI pipeline catches ESLint errors that might not break the build but indicate code quality problems.
- Use CircleCI's 'Only build default branch' option for deployment jobs while running builds on all branches for verification — this prevents feature branch experiments from accidentally deploying to production.
- Monitor your CircleCI usage in the dashboard to stay within the free tier's 6,000 credit limit; if you exceed it, consider upgrading or optimizing pipeline speed with better caching.
- Create a CODEOWNERS file in the repository to require code review before merging if multiple people push to the GitHub repository that Bolt also uses — this prevents conflicting changes from deploying automatically.
- Add the CircleCI badge to your repository README to show the current build status — this is a quick indicator of whether the latest Bolt push built successfully.
Alternatives
Travis CI offers simpler YAML configuration and is easier to get started for open-source projects, while CircleCI provides more powerful workflows, faster builds, and better resource controls for complex pipelines.
Jenkins is a self-hosted CI/CD tool that provides maximum customization and control, while CircleCI is a managed cloud service that requires no infrastructure — CircleCI is almost always the faster path for Bolt projects.
GitLab includes built-in CI/CD pipelines (GitLab CI) as part of its platform, eliminating the need for a separate CircleCI account if your team is already using GitLab for source control.
GitHub Actions (part of GitHub) offers built-in CI/CD without a separate tool, with free minutes for public repositories — a simpler alternative to CircleCI if you want to avoid adding another service to the workflow.
Frequently asked questions
Does CircleCI connect directly to Bolt.new, or does it go through GitHub?
CircleCI connects to GitHub (or GitLab/Bitbucket), not directly to Bolt.new. The integration chain is: you push from Bolt to GitHub, GitHub notifies CircleCI via a webhook, CircleCI runs your pipeline. Bolt and CircleCI never communicate directly. This means CircleCI only runs when you explicitly push from Bolt to GitHub — Bolt's internal Version History changes do not trigger CircleCI pipelines.
Can CircleCI test my Bolt app's Supabase integrations or API routes?
Yes, with some setup. CircleCI can run unit tests and integration tests against real API endpoints, but you need to provide the necessary environment variables (Supabase URL, API keys) in CircleCI's project settings. For WebContainer-specific behavior like Supabase real-time subscriptions, those tests are better run locally or in Bolt's preview. CircleCI is best for build verification, static analysis, and deployment automation.
Will CircleCI automatically redeploy when I push from Bolt to GitHub?
Yes — once the pipeline is configured and working, every push from Bolt's Git panel to the main branch will trigger a CircleCI pipeline automatically. GitHub sends a webhook notification to CircleCI within seconds of receiving a push. The pipeline then runs the full build-and-deploy process without any manual intervention. You can monitor pipeline status in the CircleCI dashboard or configure Slack/email notifications.
How do I handle the difference between Bolt's preview URL and the CircleCI-deployed URL?
Bolt's preview uses WebContainers (browser-based Node.js) at a temporary URL, while CircleCI deploys a standard Node.js build to Netlify or Vercel with a persistent URL. For most Bolt apps, the behavior is identical. Differences appear with OAuth callbacks (register the Netlify URL, not the Bolt preview URL), webhooks (use the Netlify URL), and any native Node.js modules that work in the real environment but fail in WebContainers. Always test final features on the deployed URL, not the Bolt preview.
What is the fastest way to debug a CircleCI build that fails after a Bolt push?
Go to the CircleCI dashboard, click on the failed pipeline, and expand the failed step to see the full build log. Common failure causes for Bolt projects include: TypeScript type errors that strict mode caught (check the 'Build project' step log), missing environment variables (all VITE_* vars must be in CircleCI settings), or the Netlify token having expired. CircleCI also has an SSH debug feature (available on paid plans) that lets you SSH into the build container to debug interactively.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation