Hosting static content on Gitlab with NextJs Static site?

Replace this template with your information

Repository: MegamanLegends / Sulphur Bottom · GitLab

I’m trying to use NextJs as a static site generator to host static content using Github pages. However, I keep getting 404 when trying to access the content.

The content of my .gitlab-ci.yml file is here.

image: alpine:latest

pages:
  stage: deploy
  script:
  - echo 'Nothing to do...'
  artifacts:
    paths:
    - build/
  only:
  - main

It’s basically the template for hosting static content with two small changes. The branch has been changed from master to main because that’s what I’m using. And the path is build and not public because NextJs uses the public directly to host public files like images that will be included in the build.

When I commit, the CI runs, and passes. But then when I try to open the hosted page, I just get a 404. https://megamanlegends.gitlab.io/sulphur-bottom

In terms of debugging, it feels like working with a blackbox, because I’m not able to see which files are actually being hosted. I can download the artifacts from the CI pipeline, and it shows I have files in a build folder.

But I don’t know where the mismatch is happening and why this is producing a 404, when it seems like a very small change to the static template.