Your client wants a single button in Lovable that ships changes to every active user. You already proved the update path works manually:
npx @capgo/cli@latest bundle upload --channel=production --auto-bump
The missing piece is not another terminal command inside Lovable. Lovable cannot run Capgo on Publish. When GitHub sync is enabled, Publish pushes a commit to your repo. GitHub Actions runs the build and bundle upload for you.
This guide covers the only manual setup your client must do once: add CAPGO_TOKEN as a GitHub secret. For the workflow file, copy-paste the ready AI instruction into Lovable (Step 3).
How the pipeline works
| Step | Who | What happens |
|---|---|---|
| 1 | Client | Edits the app in Lovable and clicks Publish |
| 2 | Lovable | Commits and pushes to GitHub (usually main) |
| 3 | GitHub Actions | npm ci, npm run build, bundle upload --auto-bump to Capgo |
| 4 | Capgo | Active devices on the production channel receive the update |
No SSH, no local CLI, no extra click after the secret is configured.
Prerequisites
- Lovable project connected to GitHub (export guide)
- Capacitor +
@capgo/capacitor-updaterin the repo (Lovable to mobile guide) - App registered in Capgo with
capacitor.config.tspointing at the correctappId productionchannel exists and is linked to the builds your users run
Why --auto-bump
Every Capgo upload needs a new unique bundle version. Lovable Publish does not bump package.json for you, so CI would fail on the second deploy if you reuse the same version.
--auto-bump reads the latest version on the channel (or app) and increments it. Default level is minor. You can pass --auto-bump patch or --auto-bump major if you prefer.
Step 1 — Create a Capgo API key
- Open console.capgo.app/apikeys/
- Create an API key with permission to upload bundles for your app
- Copy the key once. You will not see the full value again
Treat this key like a password. Never commit it to Git or paste it into Lovable chat.
Step 2 — Add CAPGO_TOKEN in GitHub (the only env step)
This is the step you send to Kuldeep and any client who owns the repo.
- Open the GitHub repository Lovable syncs to
- Go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
CAPGO_TOKEN - Value: paste the Capgo API key from Step 1
- Save
GitHub injects the secret into workflows as ${{ secrets.CAPGO_TOKEN }}. The workflow below reads it as the CAPGO_TOKEN environment variable for the Capgo CLI.
If the repo is under your client’s organization, they must add the secret on their repo. You only need the key in GitHub, not in Lovable settings.
Step 3 — Paste this prompt into Lovable
Copy the block below into the Lovable chat. If your default branch is not main, replace main in the workflow with your branch name.
Add Capgo Live Updates CI with GitHub Actions.
Create `.github/workflows/capgo-live-updates.yml` (create folders if needed). Start from this YAML, then adapt install/build to this project while keeping Capgo upload + CAPGO_TOKEN secret behavior:
name: Capgo Live Updates
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Install and build
run: |
npm ci
npm run build
- name: Upload bundle to Capgo
run: npx @capgo/cli@latest bundle upload --channel=production --auto-bump
env:
CAPGO_TOKEN: ${{ secrets.CAPGO_TOKEN }}
Rules:
- Do not hardcode any Capgo API key in the repo or in chat.
- The workflow must read CAPGO_TOKEN only from GitHub Actions secrets (`${{ secrets.CAPGO_TOKEN }}`).
- Keep `--auto-bump` on the upload command so each Publish gets a new unique bundle version.
- Prefer the project's real production build script from package.json (for example `npm run build` or `vite build`).
- If package-lock.json is missing, use `npm install` instead of `npm ci`.
- Do not modify app UI or Capacitor config for this task.
- Commit the workflow file so the next Publish pushes it to GitHub.
After Lovable applies the change, click Publish so the workflow lands on GitHub.
Manual alternative
If you prefer not to use the Lovable chat, create .github/workflows/capgo-live-updates.yml with this YAML only (not the prompt prose). Adapt the install/build steps the same way as the rules above if your project differs, then commit and push.
name: Capgo Live Updates
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Install and build
run: |
npm ci
npm run build
- name: Upload bundle to Capgo
run: npx @capgo/cli@latest bundle upload --channel=production --auto-bump
env:
CAPGO_TOKEN: ${{ secrets.CAPGO_TOKEN }}
Vite base path: Lovable Vite apps often need base: './' in vite.config.ts so assets load inside the native shell. If users see a white screen after an OTA update, ask Lovable to set base: './', publish again, and let the workflow redeploy.
Encrypted bundles: If you use Capgo encryption, add CAPGO_PRIVATE_KEY as a second GitHub secret and pass --key-data-v2 "${{ secrets.CAPGO_PRIVATE_KEY }}" on the upload step.
Step 4 — Confirm Publish triggers a deploy
- In Lovable, make a small visible change (for example button label text)
- Click Publish
- On GitHub, open Actions and watch Capgo Live Updates
- When the job is green, open your Capgo console and confirm a new bundle on the
productionchannel - On a device with the app installed, confirm the change arrives (may take a minute depending on channel settings)
✅ Success: Publish in Lovable → green GitHub Action → new bundle in Capgo → users get the update.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Workflow never runs | Push went to a branch other than main |
Change branches in the workflow or publish to main |
CAPGO_TOKEN / auth error |
Secret missing or wrong name | Secret must be exactly CAPGO_TOKEN under Actions secrets |
| Version already exists | Upload reused the same bundle version | Keep --auto-bump on the upload step (or pass --auto-bump patch) |
Build fails on npm ci |
Lockfile out of sync | Run npm install locally, commit package-lock.json, publish again |
| Upload succeeds, white screen | Wrong webDir or Vite base |
Match capacitor.config.ts webDir to build output (dist for Vite) and set base: './' |
| Users do not see the update | Channel not linked to their build | In Capgo, link the device build to production or set the channel to public |
For more workflow patterns (feature branches, PR channels, encryption), see GitHub Actions integration.
What you tell your client
Send them this checklist:
- You already connected Lovable to GitHub and set up Capgo on the mobile app.
- They add one GitHub secret:
CAPGO_TOKENwith their Capgo API key (apikeys page). - They click Publish in Lovable whenever they want users to receive changes.
- They never run
npx @capgo/clilocally unless they want to.
That matches the single-click experience they asked for: Publish in Lovable is the button; GitHub Actions and Capgo handle the rest.
Keep going
- Convert Lovable to iOS and Android — Full Capacitor + Capgo setup if you have not wrapped the app yet
- Automatic build and release with GitHub Actions — Tag-based releases and version bumps
- GitHub Actions integration — Multi-channel and PR preview channels
- Capgo Live Updates — Channels, rollbacks, and adoption stats