Explore manual CI/CD workflows for lovable projects: learn why they matter, build pipelines, and apply best practices.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Because Lovable is an editor/cloud-first environment without a built-in CI runner or terminal, CI/CD pipelines must be set up where builds and deploys actually run (GitHub Actions, Vercel, Netlify, etc.). Lovable’s Preview/Publish, Secrets UI, and GitHub sync are for editing, cloud previews, and exporting source — they do not substitute for an externally hosted continuous integration pipeline that runs tests, builds, and deploy steps on reproducible runners with configured env vars and secrets. Therefore CI/CD must be manually configured outside Lovable (or in the connected Git repo) so the pipeline has the right runners, environment, and access to third‑party services.
// Create a new file at docs/WHY_CICD_IS_MANUAL.md with the following content.
// Update README.md to add a short link to this docs file near deployment/CI notes.
Create file: docs/WHY_CICD_IS_MANUAL.md
Content:
# Why CI/CD Workflows Must Be Manually Configured for Lovable
Because Lovable is an editor/cloud-first environment without a built-in CI runner or terminal, CI/CD pipelines must be set up where builds and deploys actually run (GitHub Actions, Vercel, Netlify, etc.). Lovable’s Preview/Publish, Secrets UI, and GitHub sync are for editing, cloud previews, and exporting source — they do not substitute for an externally hosted continuous integration pipeline that runs tests, builds, and deploy steps on reproducible runners with configured env vars and secrets. Therefore CI/CD must be manually configured outside Lovable (or in the connected Git repo) so the pipeline has the right runners, environment, and access to third‑party services.
## Key reasons
- No terminal / no persistent runner inside Lovable: CI pipelines need a runner to execute builds/tests.
- Publish/Preview != CI: Lovable previews are not substitute for multi-step build/test/deploy workflows.
- Secrets and environment scope differ: CI providers require secrets configured in their UI and mapped into the runner environment.
- External deploy targets need external access and credentials only available to CI runners.
- Reproducibility and branching need explicit pipeline configuration tied to commits/branches.
- GitHub sync/export hands off execution responsibility to the git hosting provider — CI must be created there.
- Common breakages: missing env vars, unavailable build tools, DB migrations requiring network access, expecting Publish to run test suites.
## How this file should be used
- Point team members here when they ask "why doesn't Lovable run my tests on publish?"
- Use it as the single source of truth explaining where to configure CI and where secrets must be set (CI provider / hosting provider).
End of file
// Also update README.md: add a short sentence under "Deployment" linking to docs/WHY_CICD_IS_MANUAL.md.
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
Use Lovable Chat edits to add CI files (workflow YAMLs and package.json scripts), store runtime secrets in Lovable Secrets UI, then use Lovable’s GitHub export/sync to run CI/CD in GitHub Actions. Create .github/workflows/ci.yml and (optionally) .github/workflows/deploy.yml inside the project via Chat Mode edits, update package.json scripts, and add instructions for which repository secrets to copy into GitHub (these must be pasted into GitHub because Lovable has no terminal).
// Please create a new file at .github/workflows/ci.yml with the exact contents below.
// This workflow runs on push and pull_request, installs Node, caches npm, runs tests and builds.
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Build
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: |
./build
./dist
// Please append a new workflow file at .github/workflows/deploy.yml.
// This scaffold builds on push to main and includes a placeholder deploy step that uses a secret DEPLOY_TOKEN.
// I want you to keep the deploy step generic and comment where provider-specific actions should go.
name: Deploy
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install and build
run: |
npm ci
npm run build
- name: Deploy (placeholder)
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} // // Provide this secret in GitHub; provider-specific steps go here
run: |
echo "Replace this step with provider-specific deployment action"
# // Example: use vercel/action@v20 or netlify/actions@v1 with tokens stored in GitHub Secrets
// Please modify package.json in the repository root: add or update the "scripts" block so it includes test, build and ci.
// If package.json already has scripts, merge (do not delete) other existing scripts.
{
"scripts": {
// // run tests in CI
"test": "npm run test:unit || echo \"no test script defined\"",
// // build for production
"build": "react-scripts build || next build || vite build || echo \"define a build script\"",
// // convenience alias for CI
"ci": "npm ci && npm run test && npm run build"
}
}
// Please create a file at docs/CI-README.md with explicit steps developers should follow after we export to GitHub.
// Include which GitHub secrets to add (names and purpose) and which external provider setup is required.
# CI Checklist
// // Add these secrets to GitHub repository Settings > Secrets > Actions
// DEPLOY_TOKEN - token for your deployment provider (Vercel/Netlify/SSH key wrapped)
// DATABASE_URL - runtime database URL for integration tests (optional)
// SUPABASE_SERVICE_ROLE - only if migrations are run in CI
// // Provider notes:
// // - For Vercel: use VERCEL_TOKEN and install Vercel GitHub App or use vercel/action in deploy.yml
// // - For Netlify: use NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID
// // - For SSH deploy: store SSH_PRIVATE_KEY in GitHub secrets and use webfactory/ssh-agent action
The short answer: add small, focused CI files and npm scripts inside your Lovable project, keep secrets in Lovable Cloud for Preview/Publish, use GitHub Actions YAML placed at .github/workflows/ci.yml for longer-running or team-shared CI, cache deps and run only unit tests/builds on push, and add an integration/manual workflow for heavy tasks. Use Lovable’s chat edits and Secrets UI to make changes; only add repo-level GitHub Secrets outside Lovable (via GitHub settings) when a workflow needs them.
Best practice: update package.json to expose scripts CI can run (test, lint, build). Then add a GitHub Actions workflow file to .github/workflows/ci.yml that uses caching and runs only fast checks on push.
// Edit package.json at the project root:
// - add scripts: "test", "lint", "build"
// - keep existing fields intact
Please update package.json to add common CI scripts used by GitHub Actions and Lovable Preview:
- update root package.json: add or update the "scripts" block so it contains:
"test": "npm test --silent", // run unit tests
"lint": "eslint . --ext .js,.ts,.tsx || true", // lint but don't fail CI on missing config
"build": "npm run build" // keep existing build if present
// If package.json has a different test command, preserve content and ensure "test" exists.
Create the file .github/workflows/ci.yml with the following content:
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
node-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Run tests
run: npm run test
- name: Build
run: npm run build
// Add comments in the file to explain each step.
Best practice: use Lovable Cloud Secrets for Preview/Publish runtime values and keep a .env.example in repo. For CI running in GitHub Actions, mirror only the minimal secrets to GitHub Secrets (this step is outside Lovable).
// Create or update .env.example at project root listing required env vars:
// Example content:
# .env.example
NEXT_PUBLIC_API_URL=https://api.example.com
DATABASE_URL=postgres://user:pass@host/db
SUPABASE_SERVICE_KEY=your-service-key-here
// Then instruct Lovable to add secrets in its Secrets UI:
// Please create Lovable Cloud secrets named:
// - DATABASE_URL
// - SUPABASE_SERVICE_KEY
// - NEXT_PUBLIC_API_URL
// Set placeholders now; I'll add real values in the Secrets UI when ready.
// Create file .github/workflows/integration.yml with a workflow_dispatch trigger:
// This keeps main CI fast and runs heavy tests only manually or on schedule.
name: Integration Tests
on:
workflow_dispatch: {}
schedule:
- cron: '0 4 * * 0' // optional weekly run
jobs:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: npm ci
- run: npm run build
- run: npm run test:integration || true // mark as optional if missing
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.