www-gitlab-com Monorepo Refactor
**This project is currently paused in Q2 FY22 (for the most part) and will be incorporated into Q3 FY22 planning. The DRI is @dmor if you have any questions.**
**Status as of 2021-05-12:** Approval was given to refactor the `www-gitlab-com` repo into a monorepo with separate projects for various sections of the site: https://gitlab.com/gitlab-com/www-gitlab-com/issues/6213.
This approach was also revisited and re-validated here: https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/7898. While we will separate sections of the current site into different projects, they will continue to be deployed to the same domain (about.gitlab.com).
## Objectives
To ensure stability, accountability and efficiency we need to separate and isolate the various sub-sites in the www-gitlab-com repo.
**Separation** involves moving the actual content source files into separate Middleman projects.
- data files will be shared among the projects
- common files (JS, CSS, images, partial templates etc) will be hosted in a common space and projects can import files from there
**Isolation** involves having a separate pipeline for each project so that changes to one of them will only test, build and deploy those specific changes.
## Whiteboard snapshot

In other words, as long as the different sub-sites in the monorepo have dependencies on each other (and not just on common/top-level files), **and** we're not sure exactly what those dependencies are, we have to build and test _everything_ when anything in _any_ site is changed, to be sure that everything gets built properly and nothing gets broken.
## Requirements
1. Each project should have a pipeline that defines its test, build and deploy steps
1. Each project should have it's own separate `.gitlab-ci-xxx.yml` file
1. If changes occur in multiple projects then the pipeline for each of those should be run
1. If changes occur to shared resources (common [JS, CSS, images, partial templates etc]) and data) then all project pipelines should be run
## Proposed solution
Use the parent/child pipeline feature of GitLab CI.
The parent pipeline will be responsible for determining what changed and kicking off the relevant child pipelines.
Related but not a direct objective of this epic is the Performance epic for continuing to improve pipeline times for the sites: https://gitlab.com/groups/gitlab-com/-/epics/255
## Implementation
The 3 phases are detailed in the related issues/epics below
epic