Skip to content

pages.path_prefix not applied

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

I tried setting up parallel pages deployments as shown in https://about.gitlab.com/blog/gitlab-pages-features-review-apps-and-multiple-website-deployment/ but the pages.path_prefix does not seem to have any effect.

Steps to reproduce

  1. Configure a pipeline using the code provided in the next section.
  2. Run the pipeline to create a Pages deployment.
  3. Create a branch and merge request to main to trigger a merge request pipeline.
  4. Once it finishes, navigate to Deploy > Pages.
  5. Note that the Pages deployment created in step 2. (with no path_prefix) got updated.

Example Project

create-pages-deployment:
  stage: deploy
  script:
    - mkdir public
    - echo Hello world > public/index.html
  pages: true
  artifacts:
    paths:
      - public/
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

create-pages-review-app:
  stage: deploy
  script:
    - mkdir public
    - echo Hello world > public/index.html
  pages:
    path_prefix: 'mr-$CI_MERGE_REQUEST_IID' # Prefix with the mr-<iid>, like `mr-123`
  artifacts:
    paths:
      - public/
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

What is the current bug behavior?

The merge request pipeline updates the main Pages deployment as if the path_prefix was not set.

What is the expected correct behavior?

A parallel Pages deployment should be created by the merge request pipeline. Its URL should have an additional /mr-$CI_MERGE_REQUEST_IID path component.

GitLab environment info

GitLab Self-Managed, v18.3.1-ee

Edited by 🤖 GitLab Bot 🤖