GitHub Workflows Overwritten on WeWeb Publish

Issue Summary

WeWeb’s GitHub publishing functionality overwrites the entire branch root on every publish, which deletes custom GitHub Actions stored in .github/workflows. This prevents us from implementing automated deployment pipelines for our projects.

Impact

This is a business-critical limitation for our team. We cannot:

  • Automate deployments to staging/production environments
  • Run automated tests or quality checks on publish
  • Implement CI/CD pipelines that integrate with our existing infrastructure
  • Trigger downstream processes (notifications, cache invalidation, etc.)

Without the ability to use GitHub Actions, we’re forced into manual deployment processes that don’t scale and introduce risk of human error.

Current Behavior

  1. WeWeb publishes to GitHub
  2. The entire branch root is overwritten
  3. .github/workflows directory is deleted
  4. Any custom workflows we’ve configured are lost
  5. No GitHub Actions are triggered because they no longer exist

Possible Solutions

We see a few potential approaches that could resolve this:

  1. Selective file/folder preservation: Allow users to specify files or folders (e.g., .github/) that should not be overwritten during publish.
  2. Publish to a subdirectory: Option to publish WeWeb output to a subfolder rather than the branch root, leaving the rest of the repository intact.
  3. Merge-based publishing: Instead of overwriting, perform a merge that only updates WeWeb-managed files while preserving other files and folders.
  4. Post-publish webhook: Trigger an external webhook after publishing completes, allowing us to run automation outside of GitHub Actions.

Questions for the Development Team

  • Is the team aware of this limitation and its impact on CI/CD workflows?
  • Is there a planned solution or feature on the roadmap to address this?
  • If so, what direction is the team leaning towards, and is there an estimated timeline?
  • Are there any interim workarounds the team can recommend?

We’d appreciate any insight into how this might be resolved, as it’s currently blocking our ability to implement proper deployment automation.

Related tickets

Hi @ginkelb

Thanks so much for the detailed write‑up and for explaining how this affects your CI/CD setup, this is really helpful context.

I’ve passed your suggestions and questions on to the team so they can review options, and will update this thread as soon as there is any guidance or workaround that can be safely recommended.

Hi @ginkelb

Thanks a lot again for the detailed report and for walking through your CI/CD setup

At the moment, when WeWeb publishes to GitHub it overwrites the target folder in the branch, which means any existing .github/workflows inside that folder gets removed on each publish.

To avoid losing your workflows, the approach we recommend for now is:

  • Use your own repository root as the place for your code, config and GitHub Actions.
  • Configure WeWeb to publish its generated files into a subfolder of that repo instead of the root, for example:
my-project/
  .github/workflows/
    deploy-weweb.yml
    other-workflows.yml
  weweb-output/
    ...WeWeb generated files...
  README.md

In WeWeb, this means setting the publish path to something like weweb-output/ rather than the branch root.

One extra detail about the workflow files themselves:

  • Right now, the file uploader in WeWeb does not allow uploading files with a .yml extension directly.​
  • As a workaround, you can upload your workflow as a .txt file (for example deploy-weweb.txt) in Project files, then click Set path and change its path/name to .github/workflows/deploy-weweb.yml before publishing.​
  • After you save that path and publish, the file will appear in your repo under .github/workflows as a normal GitHub Actions workflow and GitHub will pick it up as usual.
2 Likes

Hi Agustin,

How do i setup WeWeb to publish in something like weweb-output/ rather then the branch root.

If this works it would be the perfect solution to this problem. :wink:

1 Like

Hi Guys,
Could you look at my question above?

1 Like

Hi Augustin,

I’m beginning to suspect that your proposed solution may have included some inaccurate information. My colleagues and I have searched through WeWeb but cannot find any way to do what you described:

In WeWeb, this means setting the publish path to something like weweb-output/ rather than the branch root.

Could you point us to where this setting is located? If it exists, this would resolve the issue completely. If not, it would mean WeWeb’s GitHub synchronization cannot be automated for deployment.

With kind regard,
Bas

Hey @ginkelb :waving_hand:

Apologies for the late reply. I’ve been investigating this with the team and forgot to update you last week.

In theory, this should work:

  • Adding the .yml workflow files to your WeWeb project
  • Specifying the route (e.g. `workflows/blabla.yml`)
  • Exporting the source code only to GitHub

See video: https://www.tella.tv/video/push-automations-to-github-e980

However, I tried it on my side and it doesn’t seem to be working as intended. The team needs some time to investigate further.

I’ll follow up and keep you posted here

Hi @ginkelb :waving_hand:

I can confirm:

  • we don’t have the option to push the app to a subdirectory on GitHub
  • and the workaround of uploading the GitHub workflow files to the WeWeb app and pushing only the source files to GitHub doesn’t work at the moment.

We’ve added this to our backlog but the team needs a bit more time to figure out when we can add it to the roadmap proper.

In the meantime, Adrien on our team documented a workaround that should enable you to do automated deployment and leverage GitHub actions at the same time. You’ll need two repos:

Here’s the step by step guide.

Can you take a look and let me know if that helps?

Any update on this issue? Any way we could have a fix to the github workflows added to the roadmap? The github deployment is great, except that I keep getting the 502 error (which you mention is due to too many files/icons) and not being able to run github workflows/actions when its deployed (which is becoming more of a necessity).

Sorry, I know you guys are busy with the new design, but would be great if a more solid Github functionality could be included in that :wink:

1 Like

Hey Esowers!

I actually ran into the exact same issues and ended up building a CI template that solves this: GitHub - Mel000000/weweb-cloudflare-ci: Automated CI/CD pipeline for deploying WeWeb projects to Cloudflare Pages with commit traceability and custom Vite overrides. · GitHub

It’s a bit of setup initially (I won’t lie about that :sweat_smile:), but the documentation walks you through everything step by step. The beauty is that once it’s configured, it’s completely automated, future deploys just work without you having to think about it. No more 502 errors, and you get full access to GitHub Actions for your workflows. It’s completely customizable too, so if you need other steps in your CI, it’s easy to add them.

Hope this helps with your deployment headaches! Let me know if you have any questions about getting it set up. Any feedback is appreciated!

P.S. I know this isn’t as elegant as a built-in WeWeb solution, but it does the job just fine

Ahh, thanks Mel.

After my post yesterday I looked into it again and found the after-deploy hook option. I ended up using that to trigger an n8n workflow that starts the github action.

You mentioned your script gets around the 502 errors? It appears you’re still publishing to github from weweb, how are you getting around the 502s?

Hey! My pipeline bypasses WeWeb’s built-in GitHub deployment entirely (which is where the 502s happen).

Instead, WeWeb just exports to GitHub as a source, then a Cloudflare Worker catches the webhook and triggers a GitHub Action. That Action clones the source, runs the standard build, and deploys to Cloudflare Pages. (Deployment step can be changed to any hosting type of your choosing that can handle static files.)

So the live site is built by the Action, not by WeWeb’s native deployment, that’s why the 502s don’t occur. Hope that makes sense!

If you’re interested in giving this approach a try and want some help with the setup, happy to lend a hand! :slight_smile:

Hey @esowers :waving_hand:

We fixed a bug related to this a while back. Can you tell me if:

  1. you tried exporting to GitHub recently
  2. you tried exporting on an empty GitHub repo

If yes to both, can you try adding a file manually to the GitHub repo (a README.md with lorem ipsum is fine) and then attempting the export to GitHub again?

@Joyce

Thanks for the reply. I cleared the github repository today and pushed a new update. The first deploy (source deploy) worked great, but when I went to do it a second time it ran into the 502 error

I went through and removed a whole icon library prior to these two tests to see if that was what was causing it (since previous discussions with support lead to too many files). That didn’t seem to do the trick.

As far as retaining the file. I also tried creating a file in the github actions directory .github/workflows/readme.md however when I did the next deploy the directory was removed.

Hey @esowers :waving_hand:

I think we are talking about two distinct things here.

1- the 502 error

If you haven’t already can you create a bug ticket for this please, including information to help us reproduce the issue? The team will look into it.

2- working with github workflows

Indeed, when you use our WeWeb to GitHub feature, the WeWeb code will override everything in the GitHub repo. If you want to use github workflows in combination with a WeWeb app, you will need to setup a workaround with two GitHub repos. We documented the exact steps on how to do that: Repo-A/README.md at main · weweb-adriengarcia/Repo-A · GitHub