Allow customizing the artifacts path ("public") in GitLab Pages
Proposal
Currently GitLab Pages will only publish built files from a folder named public
inside the project root.
Except for a few minor Frameworks this requires changing the default behaviour of the framework the user is using:
For example, Next.js uses .next
, Nuxt and Astro use dist
, Eleventy uses _site
, etc... — what all of them have in common is the fact, that the public
folder (sometimes in the root directory, sometimes not) often has a slightly different use: It stores static public files that don't need to go through the build process.
This means that in order to deploy a site with pages not only does the user need to configure the build path, they also often need to change where files from the original public
folders live.
So the default behaviour of Pages is almost never what the user needs. It almost always is in conflict with the default behaviour of the frameworks. This causes confusion because it's not clearly documented (#340682).
The most user-centric way to approach this is to refactor GitLab Pages so that it obtains the artifacts folder from the .gitlab-ci.yml
file and uses whatever has been specified there.