Set up Travis CI to automatically build and deploy your Bolt.new project on every GitHub push by adding a .travis.yml file to your repository. Push your Bolt project to GitHub using Bolt's built-in Git panel, connect the repository to Travis CI, add a Node.js build configuration with your deployment credentials as encrypted environment variables, and Travis will deploy to Netlify or Vercel on every commit.
Automated CI/CD for Bolt.new Projects with Travis CI
Travis CI was one of the first cloud-based CI/CD platforms, becoming particularly popular for open-source projects because of its early free tier for public repositories. While the free tier for open-source has changed over the years (Travis CI moved to a credit-based model in 2021), many developers and teams still use Travis CI for its simplicity — a single .travis.yml file at the repository root is often all that is needed to build and deploy an application.
For Bolt.new projects, Travis CI fits naturally into the GitHub-based workflow. Bolt builds features in the browser using WebContainers, pushes completed work to GitHub, and Travis CI handles the rest automatically: verifying the build succeeds, running any tests, and deploying the output to Netlify, Vercel, or another hosting platform. The entire pipeline runs on Travis CI's cloud infrastructure, so you do not need to manage any servers.
The .travis.yml configuration for Bolt projects is typically simpler than CircleCI because Travis CI has built-in deployment providers (Netlify, Heroku, S3, Firebase Hosting, etc.) that handle deployment without requiring custom shell commands. For Netlify specifically, the travis-ci/dpl (deploy tool) handles the auth and upload automatically when you provide your site ID and auth token. This built-in provider support is one of Travis CI's key advantages for Bolt developers who want a simple configuration without deep CI/CD expertise.
Integration method
Travis CI integrates with Bolt.new through GitHub as the intermediary. You push your Bolt project to a GitHub repository using Bolt's built-in Git panel, then connect Travis CI to that repository. Every subsequent push from Bolt triggers a Travis CI build that installs dependencies, runs npm run build, and deploys the output to your configured hosting platform. The .travis.yml configuration file lives in your repository and Bolt's AI assistant can help generate it.
Prerequisites
- A Bolt.new project pushed to a GitHub repository (use Bolt's Git panel to push to GitHub first)
- A Travis CI account (sign up at travis-ci.com — use the GitHub OAuth option for automatic repository access)
- A Netlify account for deployment, with a site ID and personal access token
- Basic understanding of YAML format (key-value pairs, indentation) for reading and modifying .travis.yml
- Node.js 18 or later knowledge is helpful but not required
Step-by-step guide
Push Your Bolt Project to GitHub and Connect Travis CI
Push Your Bolt Project to GitHub and Connect Travis CI
Travis CI integrates with GitHub repositories, not with Bolt.new directly. The first step is ensuring your Bolt project has a GitHub repository and that Travis CI is watching it. In Bolt, open the Git panel and use 'Push to GitHub' to create a repository for your project if you have not already. Choose a repository name (lowercase, hyphens instead of spaces), select public or private visibility, and click 'Create and push.' Bolt commits the entire project state to the new repository. With the repository on GitHub, go to travis-ci.com and sign in with your GitHub account. Travis CI uses OAuth to access your repositories and set up webhooks automatically. After signing in, click your profile icon > Settings > Repositories and find your Bolt project repository in the list. Toggle the repository to enable Travis CI — this sets up a GitHub webhook that notifies Travis whenever code is pushed. Travis CI differentiates between travis-ci.com (the current commercial platform) and the legacy travis-ci.org (which shut down in 2021). Make sure you are using travis-ci.com. If you signed up for Travis CI before 2021, your account may need migration — check the Travis CI dashboard for any migration prompts. For private repositories: Travis CI's pricing is credit-based. Free accounts receive 10,000 credits on signup, which equates to approximately 200-400 builds depending on build duration. After the initial credits are exhausted, private repository builds require a paid plan. For open-source public repositories, Travis CI offers a more generous free tier.
1# Verify the repository is properly connected by checking Travis CI's GitHub integration:2# 1. Go to github.com > Repository > Settings > Webhooks3# 2. Verify 'https://notify.travis-ci.com/...' appears as an active webhook4# 3. This confirms Travis CI will receive push notifications from GitHubPro tip: If you are building a public open-source project with Bolt, enable Travis CI before making the repository public to ensure the webhook is configured correctly from the start.
Expected result: The Bolt project repository appears in Travis CI's dashboard with the toggle enabled. A webhook from Travis CI appears in the repository's GitHub Settings > Webhooks.
Create the .travis.yml Configuration File
Create the .travis.yml Configuration File
The .travis.yml file is the single configuration file that tells Travis CI how to build and deploy your project. Place it in the root of your repository — the same level as package.json. You can create this file directly in Bolt's editor (create a new file named .travis.yml in the file tree) or add it to the GitHub repository through GitHub's web interface. Either approach works — the file just needs to be committed to the repository for Travis CI to read it. Travis CI configuration specifies: the language runtime (Node.js for Bolt projects), the Node.js version, cache settings for node_modules, the install command, the build command, and deployment settings. The configuration below works for both Vite and Next.js Bolt projects. Key configuration details: the 'node_js' key specifies which Node.js version to use — '18' uses the latest Node.js 18.x release, which matches Bolt's generation requirements. The 'cache' section with 'node_modules' tells Travis CI to cache the dependencies between builds, saving 30-60 seconds on each run. The 'install' step runs npm ci (a faster, reproducible version of npm install that uses package-lock.json). The 'script' step runs the build and fails the build if any errors occur. For Vite projects, the built output is in the dist/ directory. For Next.js projects, it is in the .next/ directory. The deploy section references these directories to know what to upload to Netlify.
Create a .travis.yml file in the project root for a Vite React project with TypeScript. It should use Node.js 18, cache node_modules, run npm ci for installation, run npm run build, and deploy the dist/ directory to Netlify using $NETLIFY_SITE_ID and $NETLIFY_AUTH_TOKEN environment variables. Only deploy on pushes to the main branch.
Paste this in Bolt.new chat
1# .travis.yml for Vite/React Bolt projects:2language: node_js3node_js:4 - '18'56cache:7 directories:8 - node_modules910install:11 - npm ci1213script:14 - npm run build1516deploy:17 provider: netlify18 site: $NETLIFY_SITE_ID19 auth: $NETLIFY_AUTH_TOKEN20 dir: dist21 prod: true22 on:23 branch: main2425# Optional: Add environment variables for Vite client-side vars26# These need to be set in Travis CI project settings:27# NETLIFY_SITE_ID, NETLIFY_AUTH_TOKEN28# VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY (if using Supabase)2930---3132# For Next.js Bolt projects, change the deploy dir:33# dir: .next34# And ensure next.config.js has output: 'export' for static output35# OR use: dir: out (if using static export)36# For SSR Next.js, consider deploying to Vercel instead of NetlifyPro tip: Travis CI also supports GitHub Pages deployment for Vite apps. Replace the Netlify deploy section with: provider: pages, skip_cleanup: true, token: $GITHUB_TOKEN, keep_history: true, local_dir: dist, on: branch: main. This is free and requires no external service.
Expected result: The .travis.yml file is committed to the repository. The next push from Bolt triggers a Travis CI build. The build log shows npm ci, npm run build, and the Netlify deploy steps.
Configure Encrypted Environment Variables
Configure Encrypted Environment Variables
Your .travis.yml references environment variables like $NETLIFY_SITE_ID and $NETLIFY_AUTH_TOKEN. These sensitive values must be stored in Travis CI's environment settings, not in the .travis.yml file itself (which is committed to your GitHub repository and visible to anyone with repository access). Travis CI provides two ways to set environment variables for a project. The first (and recommended) approach is through the Travis CI web interface: go to your project in the Travis CI dashboard, click 'More options' > 'Settings,' and scroll to the 'Environment Variables' section. Add each variable with its name and value. Travis CI stores these encrypted and makes them available to build environments as standard shell environment variables. The second approach uses the Travis CI CLI to encrypt values directly into the .travis.yml file. This is useful for open-source projects where you want to version the encrypted values alongside the configuration. Install the Travis CI gem (gem install travis), authenticate with travis login --pro, and encrypt a value with travis encrypt NETLIFY_AUTH_TOKEN=your-token --add. Travis CLI adds the encrypted value to .travis.yml under the 'env.global' key. For Bolt projects specifically: if your app uses Supabase, you need to add VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY as environment variables in Travis CI. These are used by Vite during the build process — when npm run build runs, Vite reads these variables and inlines them into the production bundle. Variables added to Travis CI's Settings panel are automatically available during the build step without any additional configuration. Get your Netlify credentials: auth token from Netlify User Settings > Applications > Personal access tokens, and site ID from your site's Settings > General > Site details.
1# Option 1: Set via Travis CI web dashboard (recommended)2# Go to: travis-ci.com > your-project > Settings > Environment Variables3# Add: NETLIFY_SITE_ID = your-site-id4# Add: NETLIFY_AUTH_TOKEN = your-auth-token5# Add: VITE_SUPABASE_URL = https://yourproject.supabase.co (if using Supabase)6# Add: VITE_SUPABASE_ANON_KEY = your-anon-key (if using Supabase)78# Option 2: Encrypt via Travis CLI (for open-source projects)9gem install travis10travis login --pro11travis encrypt NETLIFY_AUTH_TOKEN=your-actual-token --add --pro12travis encrypt NETLIFY_SITE_ID=your-site-id --add --pro13# This adds encrypted values to .travis.yml under env.globalPro tip: When adding environment variables in the Travis CI dashboard, disable the 'Display value in build log' option for all sensitive tokens and API keys. This prevents credentials from appearing in build logs that teammates can view.
Expected result: NETLIFY_SITE_ID and NETLIFY_AUTH_TOKEN (and any Supabase variables) appear in Travis CI project settings. The next build triggered by a Bolt push should complete the deploy step successfully.
Verify the Pipeline and Understand Bolt-Travis-Netlify Flow
Verify the Pipeline and Understand Bolt-Travis-Netlify Flow
With the .travis.yml committed and environment variables configured, test the complete pipeline by making a change in Bolt and pushing to GitHub. In Bolt, make any visible change to your project — update some text, change a color, add a new component element. Use Bolt's Git panel to push to GitHub. The push takes 10-30 seconds. Once the push reaches GitHub, Travis CI receives a webhook notification and starts a new build within 30-60 seconds. Watch the build progress in the Travis CI dashboard. The build log shows each step: cloning the repository, restoring the node_modules cache (or running npm ci if cache expired), running npm run build, and the Netlify deploy step. A successful build ends with a green checkmark. A failed build shows a red X and the log highlights which step failed. Green status checks also appear on GitHub — on the commit in your repository history and on any open pull requests — making it easy to see whether a Bolt push built successfully without opening the Travis CI dashboard. Understanding the Bolt-Travis relationship: Bolt's WebContainer has no direct connection to Travis CI. The pipeline only runs when you push from Bolt's Git panel to GitHub. If you make 20 AI-assisted changes in Bolt but only push once at the end, Travis CI runs one build. This is intentional — you control when the deployment pipeline triggers, not Bolt's internal Version History. The WebContainer limitation (no incoming webhooks, no public URL during development) is resolved by this deployment approach — the Travis-deployed Netlify URL works as a full production environment.
1# Monitor Travis CI builds from the command line (optional):2gem install travis3travis login --pro4travis status --pro # Show status of the most recent build5travis logs --pro # Stream the most recent build log67# Or just watch the Travis CI web dashboard:8# https://travis-ci.com/github/YOUR_USERNAME/YOUR_REPOPro tip: Enable Travis CI email notifications by adding a 'notifications' section to .travis.yml: notifications: email: on_success: never on_failure: always. This sends email only when builds fail — reducing noise while ensuring you know about build failures from Bolt pushes.
Expected result: A push from Bolt triggers a Travis CI build. The build installs dependencies, runs npm run build successfully, and deploys to Netlify. The live Netlify URL shows the updated content. Travis CI build status appears as a checkmark on the GitHub commit.
Common use cases
Simple Automated Deployment from Bolt to Netlify
Add a .travis.yml with a Netlify deploy configuration to your Bolt project's GitHub repository. Every time you push from Bolt's Git panel, Travis CI automatically builds the project and deploys the output to Netlify. No manual deploy clicks required.
Copy this prompt to try it in Bolt.new
Build Verification on Every Bolt Push
Use Travis CI to catch build failures (missing imports, TypeScript errors, broken dependencies) before they reach production. Travis CI's build result appears as a status check on each GitHub commit, making it immediately visible whether a Bolt push builds successfully.
Copy this prompt to try it in Bolt.new
Open-Source Bolt Project with Public CI
For open-source Bolt projects shared on GitHub, Travis CI's build status badge on the README provides transparency about whether the project builds successfully. Contributors can see CI status before submitting changes.
Copy this prompt to try it in Bolt.new
Troubleshooting
Travis CI build fails with 'npm run build' command not found or 'build' script missing
Cause: The package.json in the Bolt-exported project does not have a 'build' script in the scripts section, or Travis CI is running in a directory where package.json is not present.
Solution: Verify that package.json has a scripts.build entry (it should for all Bolt-generated Vite and Next.js projects). Check the Travis CI build log for the working directory — if the build runs from a wrong directory, it will not find package.json. Bolt projects should have: 'scripts': { 'build': 'vite build' } for Vite or 'scripts': { 'build': 'next build' } for Next.js.
1// Verify package.json has the build script:2// package.json:3{4 "scripts": {5 "dev": "vite",6 "build": "vite build", // or "next build" for Next.js7 "preview": "vite preview"8 }9}Travis CI shows 'Invalid credentials' or 'Netlify site not found' during deployment
Cause: The NETLIFY_AUTH_TOKEN or NETLIFY_SITE_ID environment variables are not set in Travis CI's project settings, or were set for a different Travis CI project.
Solution: Go to Travis CI > Your Project > Settings > Environment Variables and verify both NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID are listed. If they are missing, add them. If they appear to be set but still fail, the token may have been revoked — generate a new personal access token in Netlify User Settings > Applications and update it in Travis CI.
Travis CI builds succeed but the deployed Netlify app shows blank content or API errors
Cause: Client-side environment variables (VITE_* prefixed) were not added to Travis CI settings. Vite embeds these values at build time — they must be present during the npm run build step, not just at runtime.
Solution: Add all VITE_* variables to Travis CI's project settings under Environment Variables. Trigger a new build by pushing from Bolt again. Verify the build log shows the Vite build completing without 'undefined' warnings for expected env vars. The Netlify app will now have the correct values embedded in the JavaScript bundle.
1# Add to Travis CI project settings (NOT .travis.yml):2# VITE_SUPABASE_URL = https://yourproject.supabase.co3# VITE_SUPABASE_ANON_KEY = your-public-anon-key4# VITE_ANY_OTHER_PUBLIC_VAR = value5#6# These are injected by Vite at build time when 'npm run build' runs7# in the Travis CI environmentBest practices
- Add .travis.yml to your Bolt project before pushing to GitHub so the first Travis CI build runs immediately — this establishes a CI baseline from the start of the project.
- Use the Travis CI web dashboard to set environment variables rather than encrypting them in .travis.yml — the dashboard approach is cleaner for private repositories and easier to update when keys rotate.
- Set Travis CI email notifications to 'on_failure: always' and 'on_success: never' to get alerts about broken builds without constant inbox noise from successful deployments.
- Add the Travis CI build status badge to your project README for visibility: go to Travis CI > your project > click the badge icon to get the markdown code.
- Test the Travis CI pipeline early by committing a small intentional build error (like removing a required import), verifying the build fails and you receive a notification, then fixing it — this confirms the pipeline actually catches errors.
- For Bolt projects with Supabase: add VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY to Travis CI settings immediately after creating the .travis.yml, before the first build that tries to use them.
- Keep the .travis.yml simple for Bolt projects — the built-in Netlify deploy provider handles most deployment scenarios without needing custom shell scripts.
Alternatives
CircleCI offers more powerful workflow orchestration, better performance on complex pipelines, and a more generous free tier than Travis CI in 2026 — though Travis CI is simpler for straightforward Bolt deployments.
Jenkins provides full self-hosted CI/CD control with maximum customization, while Travis CI is a managed cloud service that requires no infrastructure — Travis CI is easier to set up for Bolt projects.
GitHub Actions is a built-in CI/CD system that provides similar functionality to Travis CI within GitHub itself, eliminating the need for a separate service — a simpler alternative for teams already on GitHub.
GitLab CI is built into GitLab and provides free CI/CD without requiring Travis CI, though it requires the manual export workflow since Bolt only integrates natively with GitHub.
Frequently asked questions
Is Travis CI still free in 2026?
Travis CI changed its pricing model in 2021. Free accounts receive 10,000 credits on signup (enough for 200-400 builds) but credits are exhausted over time. Open-source public repositories receive more generous credits. After the initial credits run out, paid plans start at $69/month. For simple Bolt project CI/CD on a budget, GitHub Actions (free for public repos, generous free tier for private) or CircleCI (6,000 free credits per month on a recurring basis) may be better alternatives.
How is Travis CI different from CircleCI for Bolt projects?
Travis CI's configuration is simpler — one .travis.yml with built-in deployment providers handles most Bolt deployment scenarios. CircleCI uses a more verbose .circleci/config.yml with explicit job and workflow definitions, but gives you more control over resource classes, caching, and parallel execution. For simple Bolt deployments to Netlify, Travis CI is easier to set up. For more complex pipelines (multiple environments, test suites, Docker builds), CircleCI is more capable.
Does Travis CI have direct integration with Bolt.new?
No — Travis CI integrates with GitHub, not directly with Bolt.new. The integration chain is: push from Bolt to GitHub, GitHub notifies Travis CI, Travis CI runs the pipeline. Travis CI only runs when commits reach GitHub — Bolt's internal Version History changes and preview states do not trigger Travis CI builds.
Can Travis CI deploy to Vercel instead of Netlify?
Travis CI does not have a built-in Vercel deployment provider like it does for Netlify. For Vercel deployments, the recommended approach is: push from Bolt to GitHub, connect the GitHub repository directly to Vercel (which watches for commits automatically), and let Vercel handle the build and deploy. You can still use Travis CI for running tests and verification checks, with Vercel handling deployment separately when Travis CI passes.
What happens if a Bolt push breaks the Travis CI build?
Travis CI fails the build and does not deploy. You receive an email notification (if configured) and a red X appears on the commit in GitHub. The previous successful deployment on Netlify remains live — failed builds do not overwrite the production deployment. To fix the issue, open Bolt and address whatever caused the build failure (TypeScript errors, missing dependencies, etc.), then push again from Bolt's Git panel. Travis CI runs a new build on the next push.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation