From eca9b7beba6b6b8071030b898cc94eddeb478007 Mon Sep 17 00:00:00 2001 From: Martin Donadieu Date: Thu, 6 Aug 2026 17:46:17 +0200 Subject: [PATCH 1/2] blog: add copy-paste Lovable AI prompt for Capgo Actions Co-authored-by: Cursor --- ...ive-updates-from-lovable-github-actions.md | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/apps/web/src/content/blog/en/automate-capgo-live-updates-from-lovable-github-actions.md b/apps/web/src/content/blog/en/automate-capgo-live-updates-from-lovable-github-actions.md index b8cc4d166..d47327e39 100644 --- a/apps/web/src/content/blog/en/automate-capgo-live-updates-from-lovable-github-actions.md +++ b/apps/web/src/content/blog/en/automate-capgo-live-updates-from-lovable-github-actions.md @@ -26,7 +26,7 @@ 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. +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 @@ -69,31 +69,15 @@ GitHub injects the secret into workflows as `${{ secrets.CAPGO_TOKEN }}`. The wo 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 +## Step 3 — Paste this prompt into Lovable -### Option A — Ask Lovable to create the file - -Paste this into Lovable chat (adjust branch name if your default is not `main`): +Copy the block below into the Lovable chat. Do not change it unless your default branch is not `main` (then replace `main` with your branch name). ```text -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. +Add Capgo Live Updates CI with GitHub Actions. -### Option B — Add the file yourself +Create exactly this file at `.github/workflows/capgo-live-updates.yml` (create folders if needed): -Create `.github/workflows/capgo-live-updates.yml`: - -```yaml name: Capgo Live Updates on: @@ -123,11 +107,23 @@ jobs: run: npx @capgo/cli@latest bundle upload --channel=production 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 our existing build command if package.json uses a different script than `npm run build` (for example `vite build`). Prefer the project's real production build script. +- 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. ``` -Commit and push. The first run starts as soon as GitHub receives the push. +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 the same YAML as in the prompt above, then commit and 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. +**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](/docs/live-updates/encryption/), add `CAPGO_PRIVATE_KEY` as a second GitHub secret and pass `--key-data-v2 "${{ secrets.CAPGO_PRIVATE_KEY }}"` on the upload step. From e1bf3fd3d7d8884c0fa7eb109ea01ba5f81bd00e Mon Sep 17 00:00:00 2001 From: Martin Donadieu Date: Fri, 7 Aug 2026 15:08:01 +0200 Subject: [PATCH 2/2] blog: clarify Lovable Capgo workflow prompt vs manual YAML Reconcile start-from-YAML + adapt rules, and give manual users a clean YAML block. Co-authored-by: Cursor --- ...ive-updates-from-lovable-github-actions.md | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/apps/web/src/content/blog/en/automate-capgo-live-updates-from-lovable-github-actions.md b/apps/web/src/content/blog/en/automate-capgo-live-updates-from-lovable-github-actions.md index d47327e39..5de4299ec 100644 --- a/apps/web/src/content/blog/en/automate-capgo-live-updates-from-lovable-github-actions.md +++ b/apps/web/src/content/blog/en/automate-capgo-live-updates-from-lovable-github-actions.md @@ -71,12 +71,12 @@ If the repo is under your client's organization, they must add the secret on **t ## Step 3 — Paste this prompt into Lovable -Copy the block below into the Lovable chat. Do not change it unless your default branch is not `main` (then replace `main` with your branch name). +Copy the block below into the Lovable chat. If your default branch is not `main`, replace `main` in the workflow with your branch name. ```text Add Capgo Live Updates CI with GitHub Actions. -Create exactly this file at `.github/workflows/capgo-live-updates.yml` (create folders if needed): +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 @@ -111,7 +111,7 @@ jobs: 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 our existing build command if package.json uses a different script than `npm run build` (for example `vite build`). Prefer the project's real production build script. +- 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. @@ -121,7 +121,39 @@ After Lovable applies the change, click **Publish** so the workflow lands on Git ### Manual alternative -If you prefer not to use the Lovable chat, create `.github/workflows/capgo-live-updates.yml` with the same YAML as in the prompt above, then commit and push. +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. + +```yaml +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 }} +``` **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.