'How to use GitLab / Github pages with a monorepo?
Is there a way to use Github / Gitlab pages with a monorepo? I have 1 Gitlab repo that have 3 projects:
- Angular app - admin.
- Angular app - users.
- Backend.
I will be using a paid Heroku dyno to deploy the backend. I could use (indeed, I was using) heroku too deploy the dist folders of the two Frontend projects. But because we modularized a lot our apps, and the free Heroku dynos are not specially fast, I was wondering if Github / Gitlab pages were faster. I used Gitlab pages once, but for 1 project with Gitlab CI. Does anyone knows if it is possible to do something like a page per branch, or something that I could use to deploy my 2 Frontend apps?
Solution 1:[1]
No, not really. Each project has exactly 1 pages site. Each deployment must contain all the assets for the entire site; you cannot independently build/deploy multiple apps to a single pages site.
Though, you can have multiple projects each with their own pages site. You can keep the monorepo setup and just use the additional projects as a way to deploy more sites. You can use multi-project pipelines to send artifacts built in the monorepo pipeline to downstream projects pipelines with their own pages deploy jobs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | sytech |
