The magic around GitLab pages is in the name of the job. It has to be named "pages", and nothing else. It is possible to move the job to different stages. As soon as the job "pages" has finished successfully, there's a special type of job that is called "pages:deploy". This job is shown in the deploy stage even if you change the stage that the "pages" job is run in.

If you have the pages job in an early stage, jobs in the later stages can fail but the "pages:deploy" job will still run and update GitLab pages.

Other than that, the "pages" job is just like a normal job in GitLab. If you need artifacts from other jobs, you can get these by using artifacts and dependencies:

https://docs.gitlab.com/ee/ci/yaml/#dependencies

The "pages" job should create a folder named "public" and give that folder as an artifact.

Answer from MrBerta on Stack Overflow
🌐
GitLab
docs.gitlab.com › gitlab docs › use gitlab › deploy and release your application › gitlab pages › create deployment for static site
Create a GitLab Pages deployment for a static site | GitLab Docs
In the left sidebar, select Deploy > Pages. In Deployments, you can view your active deployment URL. To visit your deployed GitLab Pages site, select the URL.
GitLab Docs
Learn how to use and administer GitLab, the most scalable Git-based fully integrated platform for software development.
Environments
That branch also deploys to an environment (for example, staging or production). ... With GitLab Route Maps, you can go directly from source files to public pages in the environment set for review apps.
GitLab Pages
GitLab Pages publishes static websites directly from a repository in GitLab. ... Deploy automatically with GitLab CI/CD pipelines.
Releases
GitLab provides an RSS feed of a project’s releases, in Atom format. To view the feed: ... In the top bar, select Search or go to and find your project. Select Deploy > Releases. ... Go to the Project overview page.
🌐
GitLab
docs.gitlab.com › gitlab docs › use gitlab › deploy and release your application › gitlab pages
GitLab Pages | GitLab Docs
To use GitLab Pages, you must create a project in GitLab to upload your website’s files to. These projects can be either public, internal, or private. By default, GitLab deploys your website from a specific folder called public in your repository. You can also set a custom folder to be deployed ...
🌐
GitLab
docs.gitlab.com › gitlab docs › use gitlab › deploy and release your application › gitlab pages › tutorial: create website from scratch
Tutorial: Create a GitLab Pages website from scratch | GitLab Docs
Save and commit the .gitlab-ci.yml file. Go to Build > Pipelines to watch the pipeline. When the pipeline is finished, go to Deploy > Pages to find the link to your Pages website.
🌐
OneUptime
oneuptime.com › home › blog › how to set up pages deployment in gitlab ci
How to Set Up Pages Deployment in GitLab CI
December 21, 2025 - GitLab Pages automatically provisions Let's Encrypt certificates for custom domains. # No special CI configuration needed for HTTPS # Enable in Deploy > Pages > Force HTTPS deploy_pages: stage: deploy script: - mv dist public pages: true artifacts: paths: - public rules: - if: '$CI_COMMIT_BRANCH == "main"'
🌐
Reddit
reddit.com › r/gitlab › gitlab pages deployment
r/gitlab on Reddit: Gitlab pages deployment
December 12, 2023 -

Greetings,

keep in mind that I come from github, where creating a github pages static website consists of just placing html files in a repository with the correct name.

I followed the guide to create a gitlab pages website. I created its script thing. Then it said it had no "runner" for the pipeline/job.

Then I created that runner, I installed gitlab-runner.exe as explained, copied the stuff it told me to copy in the command line, called gitlab-runner.exe run. The job started, and it failed. In the terminal that is running gitlab-runner I got this error:

ERROR: Job failed (system failure): prepare environment: failed to start process: exec: "pwsh": executable file not found in %PATH%. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information  duration_s=0.0085868 job=52 project=113 runner=uuj-sLTL2

I couldn't find a single gitlab guide that said anything specific about what else I need to do to setup this convoluted mess. The runners documentation doesn't mention pages deployment, the pages documentation doesn't mention runners at all.

What am I supposed to do? Where can I read about the setup steps that I'm evidently missing?

I'm also wondering, does the runner only take care of some behind-the-scenes process to build the website, and it'll be hosted in the gitlab server, or is the website going to be dependent on having the runner.exe process constantly active?

Sorry for the ranty tone, I just didn't expect this to eat up half a day.

Edit: it's likely relevant, we're not using the public gitlab website, we're using a self-hosted version within the company.

Edit edit: I fixed the issue, the runner now runs and the job completes. However i cannot access the pages page.Deploy doesn't contain any "pages" tab, only Releases, Feature flags, Package Registry. If I search "pages" in Settings/General I see an info box

GitLab Pages has moved

To go to GitLab Pages, on the left sidebar, select Deploy > Pages. ù

But the link it redirects to is a 404.

This is my .gitlab-ci.yml file:

image: alpine:latest

pages:
  stage: deploy
  script:
  - echo 'Nothing to do...'
  artifacts:
    paths:
    - public
  only:
  - master

And the public directory contains a hierarchy of html files and subdirectories. The master branch is master, no main/master issue either.

🌐
Gatsby
gatsbyjs.com › documentation › how-to guides › deploy & hosting › deploying to gitlab pages
Deploying to GitLab Pages | Gatsby
(Need help creating one? Follow the Quick Start) ... Create a new GitLab repository and add the GitLab remote. You can deploy sites on GitLab Pages with or without a custom domain.
🌐
GitLab
docs.gitlab.com › gitlab docs › use gitlab › deploy and release your application › gitlab pages › settings
GitLab Pages settings | GitLab Docs
Deploy pages from any branch using CI/CD rules. Serve pre-compressed assets for faster page loads. Customize the folder from which your site is published. Generate and manage unique domains for your sites. For an introduction to Pages, see GitLab Pages.
Top answer
1 of 2
11

The magic around GitLab pages is in the name of the job. It has to be named "pages", and nothing else. It is possible to move the job to different stages. As soon as the job "pages" has finished successfully, there's a special type of job that is called "pages:deploy". This job is shown in the deploy stage even if you change the stage that the "pages" job is run in.

If you have the pages job in an early stage, jobs in the later stages can fail but the "pages:deploy" job will still run and update GitLab pages.

Other than that, the "pages" job is just like a normal job in GitLab. If you need artifacts from other jobs, you can get these by using artifacts and dependencies:

https://docs.gitlab.com/ee/ci/yaml/#dependencies

The "pages" job should create a folder named "public" and give that folder as an artifact.

2 of 2
1

The magic around GitLab pages is in the name of the job. It has to be named "pages", and nothing else.

Not anymore: See GitLab 17.6 (November 2024)

Deploy your Pages site with any CI/CD job

To give you more flexibility in designing your pipelines, you no longer need to name your Pages deploy job pages.
You can now simply use the pages attribute in any CI/CD job to trigger a Pages deployment.

See Documentation and Issue.

Example:

deploy-my-pages-site:
  stage: deploy
  script:
    - npm run build
  pages: true  # specifies that this is a Pages job
  artifacts:
    paths:
      - public

If the pages property of a job named pages is set to false, no deployment is triggered

Find elsewhere
🌐
GitLab
about.gitlab.com › blog › product › build a new website in a few easy steps with gitlab pages
Build a new website in a few easy steps with GitLab Pages
March 3, 2025 - There are two ways to create the GitLab CI configuration file that tells GitLab how to build and deploy your site: ... Go to your project's Build > Pipeline Editor. The .gitlab-ci.yml file will be automatically created. 3. Copy and paste the following configuration: ... pages: stage: deploy script: - mkdir .public - cp -r * .public - mv .public public artifacts: paths: - public only: - main
🌐
Gitlab
k33g.gitlab.io › articles › 2020-07-23-GITLAB-PAGES-EN.html
🇬🇧 Every GitLab Page deserves a real CI/CD | K33G's website
Commit your source code, then the pages job will be triggered and followed by a pages:deploy job. Wait a moment, and a few seconds later you should reach your pages at this url: https://<YOUR_GROUP_NAME>.gitlab.io/<YOUR_PROJECT_NAME> (opens new window) (in my case, if you want to see the result, it's: https://my-little-pages.gitlab.io/food-and-drinks (opens new window))
🌐
Nira
nira.com › home › the ultimate manual to gitlab pages
The Ultimate Manual To GitLab Pages - Nira
May 3, 2022 - To use GitLab Pages, you have to ... in GitLab to upload your website files. GitLab Pages will always deploy your website from a specific folder called public in your repository....
🌐
CraftedTemplate
craftedtemplate.com › blog › how-to-deploy-a-site-with-gitlab-pages
How to Deploy a Site with GitLab Pages (Step-by-Step Guide) — CraftedTemplate
September 30, 2025 - In the root of your repo, create a file named .gitlab-ci.yml with this content for static sites: ... pages: stage: deploy script: - mkdir .public - cp -r * .public artifacts: paths: - .public only: - main
🌐
Zola
getzola.org › documentation › deployment › gitlab-pages
GitLab Pages | Zola
# For example: "0.17.2" or "0.18.0". ZOLA_VERSION: description: "The version of Zola used to build the site." value: "" pages: stage: deploy script: - | apt-get update DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends wget ca-certificates zola_url="https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" if ! wget --quiet --spider $zola_url; then echo "A Zola release with the specified version could not be found." exit 1 fi wget $zola_url tar -xzf *.tar.gz ./zola build --base-url $CI_PAGES_URL artifacts: paths: # This is the directory whose contents will be deployed to the GitLab Pages server.
🌐
GitLab
docs.gitlab.com › gitlab docs › use gitlab › deploy and release your application › gitlab pages › parallel deployments
GitLab Pages parallel deployments | GitLab Docs
Automatically appending pages.publish path to artifacts:paths introduced in GitLab 17.10 for Pages jobs only. With parallel deployments, you can publish multiple versions of your GitLab Pages site at the same time.
🌐
Publii
getpublii.com › docs › host-static-website-gitlab-pages.html
How to create a static website using GitLab Pages (Full Guide)
August 8, 2024 - On the next screen, for the Filename, type .gitlab-ci.yml and in the main code window, paste the following code: image: alpine:latest pages: stage: deploy script: - echo 'Nothing to do...' artifacts: paths: - public/ only: - main