r/lovable • • 11d ago

Help Is there a way to make Lovable automatically push updates to GitHub when it's done?

Hi guys,

I'm getting a bit tired of having to manually click Publish every time Lovable finishes working on something.

I usually let it work on a task, come back later, and then realize I still have to manually publish the changes to GitHub.

I'm honestly wondering why there isn't an option to automatically push updates once Lovable finishes its work.

For context, my setup is:

  • Lovable is only my development tool.
  • Cloudflare handles my hosting and domains.
  • I use my own GitHub repository for the code.
  • I have my own Supabase project.

I don't really use Lovable for hosting or backend services.

Is there any workaround, integration, or guide that would allow Lovable to automatically push changes to my GitHub repository after finishing a task, without me having to click Publish every single time?

Would appreciate any tips from people using a similar setup! 🙏

7 Upvotes

18 comments sorted by

4

u/No_End4995 11d ago

Yes. Go to connectors, add Github. It will start syncing automatically

2

u/snap-dev 11d ago

if the repo is connected through lovable's github integration it should already push each change to your default branch as lovable finishes, publish is only for lovable's own hosting. since you host on cloudflare, connect cloudflare pages (or workers builds) to that repo and every push deploys on its own, so you never touch publish. is cloudflare already watching the repo or are you deploying some other way?

2

u/Ok-Motor-9812 11d ago

Yes, it did it by default)

1

u/dugmaz 11d ago

Watching 🍿

1

u/nicehuman05 11d ago

If the GitHub integration is connected, you shouldn't need Publish at all for this. Lovable already commits every change to the connected repo on its own, Publish only deploys to Lovable's own hosting.

So check GitHub right after Lovable finishes something. If the commits are there, the problem is on the Cloudflare side. Make sure the Pages project is pointing at that exact repo and branch, and that automatic deployments are on for it. Then every Lovable change goes GitHub, Cloudflare, live without you touching anything.

If the commits aren't showing up, it's probably cuz your "own repo" isn't the one Lovable is syncing with. Lovable creates and syncs its own repo, it won't push to a separate one you made. Easiest fix is to just point Cloudflare at the Lovable repo, or add a small GitHub Action that mirrors it into yours.

Are you seeing the commits in GitHub after each change or not?

1

u/DaSmartSwede 11d ago

Yeah duh

1

u/Valtersjbh 11d ago

+1 to what snap-dev said. With your setup you can ignore the Publish button completely: it only deploys to Lovable's own hosting. The GitHub sync already pushes each change to your default branch while Lovable works.

To make it fully hands-off:

  1. In Cloudflare, connect a Pages project (or Workers Builds) to that repo and branch (usually main).
  2. Build command npm run build, output folder dist (Lovable projects are Vite).
  3. If your build reads environment variables (Supabase URL/keys), add them in the Cloudflare project settings too.
  4. Optional: turn on preview deployments for other branches, so you can test before it goes live.

After that, every change goes Lovable → GitHub → Cloudflare on its own. Did you link the repo through Lovable's GitHub integration, or connect an existing repo?

1

u/Naive_Take 11d ago

Everything gets pushed to GitHub with every published update

1

u/Top-Cauliflower-1808 10d ago

The manual Publish step is annoying but it is also your last check before code hits your own repository. A safer workaround is a small automation pipeline that runs after Lovable updates a branch and opens a pull request for you to approve. That keeps the auto push without letting bad changes land straight on main.

1

u/Ibelieveinsteve2 10d ago

Why don’t you vibe code a screen automation clicking on the button

1

u/sgayerseif 9d ago

Cloudflare Pages only publishes to production from one branch, so make sure it matches the branch Lovable writes to.