Hosting my static Angular site on Gitlab Pages isn't working

I’m trying to host my static Angular site on Gitlab Pages, but when I try to navigate to the site, it loads a blank page, which does not happen when I serve it locally. I’m following the instructions on the Angular docs here https://angular.io/start/start-deployment, which says that the static files are located here: dist/my-project-name.

Here is my Gitlab CI (which passes):

image: node:latest

pages:
  cache:
    paths:
    - node_modules/

  stage: deploy
  script:
  - npm install -g @angular/cli@9.1.8
  - npm install
  - ng build --prod
  - mkdir public
  - mv dist/my-website/* public/
  artifacts:
    paths:
    - public
  only:
  - master

Does anyone happen to know why my Angular site isn’t appearing as intended?

Hi @PhantomTriforce, welcome to the forum!

Have you tried downloading the artifacts from the job? That should have just 1 folder named public in it. I’m wondering if your mv command is causing a directory structure that is like public/public whereas GitLab pages is expecting just public

Hi @olearycrew, thanks for the welcome.

I downloaded the artifacts like you suggested, but the structure looks as intended (artifacts -> public -> assets and rest of my files).

Also just to see if I was doing anything wrong, I tested hosting a simple HTML file (not Angular) which worked fine, indicating my process was right and the bug I’m running into is Angular specific.

Any additional thoughts are welcome!