GitHub Push overwrites vercel.json and workflows

Hey everyone,

I’m working on a project with WeWeb + GitHub + Vercel and ran into an issue I can’t find a good workaround for.

WeWeb’s GitHub publishing seems to completely overwrite the branch root on every publish – including:

  • my vercel.json file
  • my custom GitHub Actions under .github/workflows

Even if I try to include the vercel.json file via the “files” option in WeWeb, it ends up in the wrong place: public/vercel.json.
This breaks things like SPA rewrites and other Vercel config.

I also can’t use a GitHub Action to move the file back after publishing, because the .github folder is already deleted when WeWeb overwrites the branch.

I would really like to keep using the built-in WeWeb → GitHub push functionality – I’d prefer not to download the export manually and push it myself.

Is there a way to publish into a subfolder of the branch instead of the root? Or any trick to preserve certain folders/files during a publish?

Would love to hear how others handle this!

Thanks :folded_hands:

Hi Fynn :waving_hand:

While we wait to see how others have solved this, I’ll ask if someone from the support team has an answer for this.

1 Like

Hi Fynn,

In your case presumably I’d try to create new repo (let’s call it “wrapper repo”) and store the vercel.json inside a root folder. Then I’d create in the root folder another folder (let’s call it “weweb_project”) and set this “weweb_folder” as a root directory in vercel project settings.

Then we need a trigger (Github action maybe? not familiar either) which will fire each time when Weweb pushes a new version:

  1. delete existing files in “weweb_project” (if any)
  2. copy the new Weweb project from “weweb repo” to “wrapper repo/weweb_project”

I think this should work. Vercel will get static files of the project from “weweb_project” and the config from the vercel.json placed in the root of the repo. So Weweb won’t be able to overwrite anything.

Let me know if this works.

1 Like

The probably simplest solution to this seems to be just pull the vercel.json from the /public via a Workflow :smiley:

WeWeb overrides the Worflows in the branch so nothing gets triggered. I’ve also tried triggering workflows from other branches, for example, when pushing to staging. No success.