Posted at

gitlab pagesのartifacts pathsはpublicじゃないとダメ

More than 1 year has passed since last update.


問題

buildはpassしてるのに、なぜかdeployがfailedになる


gitlab-ci.yml

image: node

before_script:
- npm install

cache:
paths:
- node_modules/

pages:
stage: deploy
script:
- npm run build
artifacts:
paths:
- dist
only:
- master



解決

ドキュメントを見直すとgitlab pagesのartifacts pathsはpublicじゃないとダメらしい

build後にmvして解決した


gitlab-ci.yml

image: node

before_script:
- npm install

cache:
paths:
- node_modules/

pages:
stage: deploy
script:
- npm run build
- mv dist public
artifacts:
paths:
- public
only:
- master



参考

https://docs.gitlab.com/ce/ci/yaml/#pages