Allow testing documentation pages via MRs

Migrated issue

Reported by: fjgarlin

Related to !403 (closed) !149 (closed)

Problem/Motivation

Currently, the documentation site is only built on commits to the main branch. It'd be useful to have separate sites per MR, like this https://docs.gitlab.com/ee/user/project/pages/#use-multiple-deployments-to-create-pages-environments, but I'm not sure if this is possible, so let's investigate here.

Steps to reproduce

Create MR with changes to the docs. Nothing will be built in the MR, tho you can still see it all locally.

Proposed resolution

See if the suggested approach works, otherwise continue with what we have. [update - it does not, but there are other ways to do it]

The requiements are:

  1. The pages job needs to run in a push pipeline to the default branch if any documentation source files have been changed in the commit.
  2. The pages job needs to be run in a MR if there are changes to any documentation files
  3. The 'push pipeline' page job (1) will run automatically, but the 'mr pipeline' page job (2) should be manual, so that it does not run and waste resource when making other non-doc changes in the MR
  4. The MR pages job needs to create the documentation site in a separate location from the "real" doc site.

Related issue: Issue #3423238

Edited by drupalbot