In my experience you can have multiple pages
jobs but with different names.
It is important to have at least on job that is named exactly pages
.
Then you can have other jobs that just copy stuff to public
and they will also be available.
Below is an example of my configuration:
pages: # IMPORTANT! at least one job needs to be named "pages" otherwise the content will not be available
stage: deploy
script:
# copy the pdf file into the public folder
- mkdir -p public/First
- cp My_File.pdf public/First
artifacts:
paths:
- public # instruct GitLab to keep the public folder
pages_2:
stage: deploy
script:
# copy the pdf file into the public folder
- mkdir -p public/Second/
- cp My_File.pdf public/Second
artifacts:
paths:
- public # instruct GitLab to keep the public folder
Also GitLab could release an interesting new feature in the future as discussed here: https://gitlab.com/gitlab-org/gitlab/-/issues/277351