Pages: run pages:deploy only on master, but build pages on other branches

Hello;

Is there any way for me to configure my .gitlab-ci.yml for gitlab pages so it runs the build and keeps the artifacts on some branches, while only publishing the pages for the master branch? What I got is:

pages:
  image: webuni/mkdocs
  script:
    mkdocs build
  artifacts:
    paths:
    - public
  only:
  - master
  - /^r.*$/

And I want something like:

pages:deploy:
  only:
  - master

The motivation is I have some colleagues that need to download the site and review it (so the r- prefixed branches there), but only after merged into master they can be shown to the world.

Is there any way to do so?

Thanks!

Never mind, I ended up duplicating the pages job, as written here:

https://docs.gitlab.com/ce/user/project/pages/getting_started_part_four.html#stages