Now in 2024 we can publish GitLab-pages in another folder than public.
To do so, in your .gitlab-ci.yml add : publish: dist
A short but working example :
pages:
script:
- ls
artifacts:
paths:
- dist
publish: dist
For more, I found the publish syntax there.
And if you prefer, there are some workaround explained in the official documentation.