Improve `pages:` job options: Use pages.publish as an artifacts.paths automatically

Problem

When enabling multiple pages jobs a new pages: job option was created, but the MVC version of this option is quite verbose and don't contains all pages-related ci options.

Proposal

  • Use public directory automatically for artifacts.paths when pages.publish not defined for pages job only
  • Use any value defined in pages.publish as an artifacts.paths automatically
  • Update documentation

Examples

Simplest possible pages job:

This will use all defaults

  • pages.path_prefix: ''
  • pages.publish: /public
  • artifacts.paths: /public
my-pages-job: 
  script:
  - echo 'something'
  pages: true 

Or even shorter with the old way of specifiying pages as the job name:

pages: 
  script:
  - echo 'something'

Fully customised pages job:

job-name: 
  script:
  - echo 'something'
  artifacts:
    paths:
      - other
  pages:
    path_prefix: 'staging' 
    publish: '/some-folder'

Having artifacts.paths and pages.publish means that multiple artifacts are created, so the above should be equivalent to:

job-name: 
  script:
  - echo 'something'
  artifacts:
    paths:
      - other
      - /some-folder
  pages:
    path_prefix: 'staging' 
    publish: '/some-folder'

Related to:

Edited by Naman Jagdish Gala