Lovable has no built-in CI/CD, but you can add automated build, test, and deploy pipelines by connecting your project to GitHub and configuring GitHub Actions or a platform like Vercel. After enabling GitHub integration (Settings, then Connectors, then GitHub), every push triggers your workflow. For Vercel, import the GitHub repo and it auto-deploys on each commit. For GitHub Actions, add a workflow YAML file to .github/workflows/ that runs your build and test commands.
Why CI/CD workflows must be manually configured for Lovable
Lovable does not include built-in continuous integration or continuous deployment pipelines. When you click Publish in the Lovable editor, it deploys a snapshot of your current project — but there is no automated testing, no staging environment, and no branch-based deployment preview. For simple projects, this is fine. But as your project grows and you start collaborating with others through GitHub, you need automated workflows to catch bugs before they reach production. CI/CD solves three problems: it automatically tests your code when changes are pushed (so you catch errors before deploying), it deploys to staging or preview URLs for review (so you can test changes without affecting production), and it deploys to production automatically once changes are approved (so you do not have to manually click Publish every time). The most common approach for Lovable projects is to connect to GitHub, then use either GitHub Actions for custom workflows or Vercel/Netlify for automatic deployment. Since Lovable syncs code to GitHub on every AI interaction, your CI/CD pipeline runs automatically whenever the AI makes changes.
- Lovable has no built-in CI/CD — automated testing and deployment require external tools
- No automated testing before publish — errors in generated code can reach production uncaught
- No branch-based previews natively — you cannot preview changes on a separate URL before merging
- Manual publish required — clicking Publish every time is error-prone and easy to forget
- No staging environment — there is no way to test production builds separately from the live site
Error messages you might see
Error: Process completed with exit code 1 (GitHub Actions build step)The build command failed in your GitHub Actions workflow. Check the workflow run logs on GitHub for the specific error — usually a TypeScript compilation error or missing dependency. This catches errors that would otherwise only appear after publishing.
Vercel: Build failed — npm ERR! Missing script: 'build'Vercel cannot find the build command in your package.json. Lovable projects use 'npm run build' which maps to the Vite build. Ensure your package.json has a build script defined, or configure the build command as 'npx vite build' in Vercel settings.
GitHub Actions: Resource not accessible by integrationThe GitHub Actions workflow does not have the right permissions. Add 'permissions: contents: read' to your workflow file, or check that the Lovable GitHub App has the necessary repository access.
Before you start
- A Lovable project with GitHub integration enabled (Settings, then Connectors, then GitHub)
- A GitHub repository connected to your Lovable project
- A Vercel, Netlify, or similar hosting account (for automatic deployment)
- Basic understanding of what CI/CD does (automated testing and deployment)
How to fix it
Enable GitHub integration to sync code automatically
CI/CD pipelines need access to your code in a Git repository — GitHub is the bridge
Enable GitHub integration to sync code automatically
CI/CD pipelines need access to your code in a Git repository — GitHub is the bridge
If you have not already connected GitHub, go to Settings, then Connectors, then GitHub, and click Connect GitHub. Complete the OAuth flow and install the Lovable GitHub App on your account or organization. Then click Connect project to create a GitHub repository and start two-way sync. Every change the AI makes in Lovable automatically appears as a commit in GitHub, which triggers your CI/CD workflows.
Expected result: Your Lovable project is synced to a GitHub repository. Every AI change creates a new commit that can trigger CI/CD workflows.
Set up Vercel for automatic deployment on every push
Vercel auto-deploys every commit and creates preview URLs for branches — zero configuration needed
Set up Vercel for automatic deployment on every push
Vercel auto-deploys every commit and creates preview URLs for branches — zero configuration needed
Go to vercel.com, sign in, and click 'Add New Project.' Import your Lovable GitHub repository. Vercel auto-detects the Vite framework and configures the build settings (build command: npm run build, output: dist, Node: 22). If your project uses Supabase, add the environment variables VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY, and VITE_SUPABASE_PROJECT_ID in the Vercel project settings. Click Deploy. From now on, every push to your GitHub main branch triggers a production deployment, and every push to other branches creates a preview deployment with a unique URL.
1// vercel.json — add to project root for SPA routing2{3 "rewrites": [4 { "source": "/(.*)", "destination": "/index.html" }5 ]6}Expected result: Every commit to GitHub automatically deploys to Vercel. Branch pushes get unique preview URLs for testing before merging.
Add a GitHub Actions workflow for build verification
GitHub Actions runs your build on every push and catches TypeScript errors before deployment
Add a GitHub Actions workflow for build verification
GitHub Actions runs your build on every push and catches TypeScript errors before deployment
Create a workflow file that runs on every push and pull request. The workflow installs dependencies, runs the TypeScript compiler check, and builds the project. If any step fails, the push is flagged with a red X on GitHub. You can add this file through Dev Mode in Lovable or by committing directly to your GitHub repository. Create the file at .github/workflows/ci.yml in your project. If configuring GitHub Actions alongside Lovable's sync feels complex, RapidDev's engineers can set up your complete CI/CD pipeline with proper caching and environment variable handling.
# No CI workflow — errors are only caught when you manually test# .github/workflows/ci.ymlname: Build Checkon: push: branches: [main] pull_request: branches: [main]jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 22 cache: npm - name: Install dependencies run: npm ci - name: Type check run: npx tsc --noEmit - name: Build run: npm run build env: VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} VITE_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY }}Expected result: Every push to main and every pull request runs a build check. Failed builds show a red X on GitHub, preventing broken code from reaching production.
Add environment secrets to GitHub for the CI workflow
Your build needs Supabase environment variables, but they should never be hardcoded in the workflow file
Add environment secrets to GitHub for the CI workflow
Your build needs Supabase environment variables, but they should never be hardcoded in the workflow file
Go to your GitHub repository, then Settings, then Secrets and variables, then Actions. Click New repository secret. Add VITE_SUPABASE_URL with your Supabase project URL, and VITE_SUPABASE_PUBLISHABLE_KEY with your Supabase anon key. These values are available in your Lovable project's Cloud tab under Secrets, or in the .env file in Dev Mode. The GitHub Actions workflow references these using the ${{ secrets.SECRET_NAME }} syntax.
# Build fails because env vars are missing# Error: VITE_SUPABASE_URL is not defined# GitHub repository → Settings → Secrets → Actions# Add these secrets:# VITE_SUPABASE_URL = https://your-project.supabase.co# VITE_SUPABASE_PUBLISHABLE_KEY = eyJhbGc...## The workflow references them with:# env:# VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}Expected result: The GitHub Actions build step can access Supabase environment variables without exposing them in the repository code.
Complete code example
1name: CI/CD Pipeline23on:4 push:5 branches: [main]6 pull_request:7 branches: [main]89jobs:10 build-and-check:11 runs-on: ubuntu-latest1213 steps:14 - name: Checkout code15 uses: actions/checkout@v41617 - name: Setup Node.js 2218 uses: actions/setup-node@v419 with:20 node-version: 2221 cache: npm2223 - name: Install dependencies24 run: npm ci2526 - name: TypeScript type check27 run: npx tsc --noEmit28 # Catches type errors without producing output files2930 - name: Build production bundle31 run: npm run build32 env:33 VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}34 VITE_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY }}35 VITE_SUPABASE_PROJECT_ID: ${{ secrets.VITE_SUPABASE_PROJECT_ID }}3637 - name: Check build output exists38 run: |39 if [ ! -d "dist" ]; then40 echo "Build output directory 'dist' not found"41 exit 142 fi43 echo "Build successful — dist/ contains $(find dist -type f | wc -l) files"Best practices to prevent this
- Connect GitHub before setting up CI/CD — Lovable's two-way sync ensures every AI change triggers your pipeline automatically
- Use Vercel for the simplest deployment setup — it auto-detects Vite projects and creates preview URLs for every branch
- Add a TypeScript type check step (npx tsc --noEmit) to catch errors the AI introduces before they reach production
- Store all environment variables in GitHub Secrets — never hardcode Supabase URLs or keys in workflow files
- Use npm ci instead of npm install in CI workflows — it is faster and ensures reproducible builds from the lockfile
- Enable branch-based previews (Vercel does this automatically) so you can test changes before merging to main
- Cache node_modules in GitHub Actions using actions/setup-node with cache: npm to speed up builds
- Add a vercel.json with SPA rewrites to prevent 404 errors on direct page navigation in the deployed app
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I have a Lovable (lovable.dev) project connected to GitHub. I want to set up a CI/CD pipeline. My project uses: - Vite + React + TypeScript + Tailwind CSS - Supabase for backend - GitHub for version control I want: 1. A GitHub Actions workflow that runs TypeScript checks and builds on every push 2. Automatic deployment to Vercel on every push to main 3. Preview deployments for pull requests 4. Proper environment variable handling for Supabase credentials Please: 1. Write the complete .github/workflows/ci.yml file 2. Show me the vercel.json configuration for SPA routing 3. List which GitHub Secrets I need to add 4. Explain how to connect the GitHub repo to Vercel
Add a GitHub Actions CI workflow to my project. Create the file at .github/workflows/ci.yml with these steps: 1) Checkout code. 2) Setup Node.js 22 with npm caching. 3) Run npm ci to install dependencies. 4) Run TypeScript type checking with npx tsc --noEmit. 5) Run npm run build with Supabase environment variables from GitHub Secrets. Also create a vercel.json file in the project root with SPA rewrite rules so all routes serve index.html.
Frequently asked questions
Does Lovable have built-in CI/CD?
No. Lovable publishes snapshots when you click Publish, but there is no automated testing, staging environment, or branch-based deployment. You need to set up CI/CD externally using GitHub Actions, Vercel, Netlify, or similar tools after connecting your project to GitHub.
What are good CI/CD workflow examples for Lovable?
The most common setup is GitHub Actions for build verification (TypeScript check + Vite build) combined with Vercel for automatic deployment. Every push to main deploys to production, and every pull request gets a preview URL. Add environment variables as GitHub Secrets for the build step.
Which platforms offer exportable code and CI/CD integrations like Lovable?
Lovable exports to GitHub, which connects to virtually any CI/CD platform. Vercel and Netlify are the most popular for Lovable projects because they auto-detect Vite configurations and provide preview deployments. GitHub Actions handles custom build and test workflows.
How do I set up preview deployments for Lovable branches?
Connect your GitHub repo to Vercel. Vercel automatically creates a unique preview URL for every push to a non-main branch. Enable branch switching in Lovable (Settings, then Account, then Labs) to create branches from the Lovable editor. Each branch push triggers a preview deployment on Vercel.
Do I need to add environment variables to my CI/CD platform?
Yes. Lovable Secrets are not automatically shared with external platforms. Add your Supabase environment variables (VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY, VITE_SUPABASE_PROJECT_ID) to GitHub Secrets for Actions workflows, and to Vercel project settings for deployments.
What if I can't set up CI/CD myself?
CI/CD configuration involves GitHub Actions YAML syntax, environment variable management, and platform-specific settings. RapidDev's engineers can set up your complete pipeline including build checks, automated testing, staging previews, and production deployment in one session.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your issue.
Book a free consultation