Cloudflare Monorepos, deployed to pages with GitHub action

We converted our repository into a monorepo, as we were adding a second app that needed to share components. We quickly found out that the dashboard automatic deploys don't work with monorepos, so we switched to using the GitHub actions to directly upload. (Looks like it's using Wrangler?) I'm a front-end dev getting "wrangled" into dev ops, so feeling out of my depths. Now I'm trying to figure out how to configure the monorepo to deploy as two separate app, but I'm not finding a lot of resources. Still knee deep in researching, but I was wondering if anyone here has any pointers. - Do you need multiple "projects" to deploy multiple apps from the same repo? Or can you stick with one? (It won't let me make a new page pointed at the same repo from dashboard "new page") - If not, can you add multiple production branch deployments? I'm not seeing that options in the dashboard. - It offers a "direct file upload" option, but that is not viable because we want to deploy from our repository. It seems like Cloudflare is capable of handling Monorepos, but isn't too directly supporting them yet. So I'm pretty sure the solution is out there, just buried.
3 Replies
Erisa
Erisa12mo ago
You can only have one project linked to a given github repo but that link only applies if you're using the Pages built-in automatic deploys. You can create as many direct upload projects as you need and then upload to those using Github Actions
logan
logan9mo ago
Sorry for hijacking this thread, but it was the only one I found when searching for monorepo in the general-help channel. Does Cloudflare have any suggestions for teams looking to use a monorepo for their workers/pages?
Erisa
Erisa9mo ago
Please create a new thread instead of reviving an old one, you can copy the link for this thread and reference it in your thread for cross-reference. This helps us organise different question/responses separately without causing conflicting/confusing information to be given. To the question: my answer here is still the most up to date information, there is no explicit support for monorepos yet and you would have to use GitHub Actions using Direct Uploads instead. I will lock this thread but please open a new one if you need more information or have further questions.
Want results from more Discord servers?
Add your server