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
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. Everything else can be added with a Lovable prompt or a small workflow file.
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 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
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 — Add the GitHub Actions workflow
Option A — Ask Lovable to create the file
Paste this into Lovable chat (adjust branch name if your default is not main):
Create `.github/workflows/capgo-live-updates.yml` that runs on every push to `main`:
1. Checkout code
2. Setup Node.js 24 with npm cache
3. Run `npm ci` and `npm run build`
4. Run `npx @capgo/cli@latest bundle upload --channel=production`
5. Use environment variable `CAPGO_TOKEN` from GitHub Actions secrets (do not hardcode the API key)
Use `actions/checkout@v6` and `actions/setup-node@v6`. Commit the workflow file to the repo.
Lovable will add the YAML and push it on the next Publish.
Option B — Add the file yourself
Create .github/workflows/capgo-live-updates.yml:
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
env:
CAPGO_TOKEN: ${{ secrets.CAPGO_TOKEN }}
Commit and push. The first run starts as soon as GitHub receives the push.
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, fix 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 |
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