What causes the GitLab Pages step `pages:deploy` to fail in CI/CD, and how can I debug it?

Here’s my CI/CD config for GitLab pages, running on GitLab.com:

image: nixos/nix:latest

variables:
  GIT_SUBMODULE_STRATEGY: recursive

pages:
  stage: deploy
  cache:
    paths:
      - dist-newstyle
  script:
    - nix-shell --run shake
  artifacts:
    paths:
      - dist
  only: 
    - master

It completes successfully, and saves build artifacts to /dist. Yet the following step, pages:deploy, fails, and is retried five more times, each time failing again.

From what I can tell, there are no logs for pages:deploy, which is marked as external.

I expect this to pass, but it fails.

I’ve looked through the Troubleshooting CI/CD and can’t find anything relevant to this issue.

This is on the private repo lilielbe_WebDevel, if that helps anyone. It’s just a static website which uses the Haskell build tool Shake to create a directory of HTML pages.

Hi @JonathanReeve

GitLab pages only looks for files in a directory called public. If you change your config to:

pages:
  stage: deploy
  cache:
    paths:
      - dist-newstyle
  script:
    - nix-shell --run shake
    - mv dist public
  artifacts:
    paths:
      - public
  only: 
    - master

or similar, then I think you’ve got a good chance of this working!

Regards,

Sarah