continuous-integration - Gitlab 页面 CI/CD 管道正在通过,但生成的页面不加载资源
问题描述
这是.gitlab-ci.yml
文件:
pages:
stage: deploy
script:
- apt-get update
- apt-get install -y nodejs npm # install NPM in order to build the website
- npm install
- npm run build # build the website
- mv dist public # move the built website to the public directory
artifacts:
paths:
- public
only:
- master
管道通过,即作业pages
和pages:deploy
正在通过。该网站也正确构建:当我下载工件时,所有资源都存在于public
目录中。
但是,当我查看生成的网站时,index.html 正在加载,但所有资源都没有(404 代码)。
这是回购:https ://gitlab.com/Cl00e9ment/kingdom-blazon-generator
解决方案
GitLab 的页面只支持静态网页,不支持动态网页。这意味着您不能运行类似的服务器node.js
,而只能生成 HTML 和其他静态文件。
你可以在这里读更多关于它的内容:
推荐阅读
- elixir - (FunctionClauseError) CheckersgameWeb.GamesChannel.handle_in/3 中没有函数子句匹配
- python-3.x - 临时变量的变化正在影响从中提供的变量
- c# - 如何在mongodb + C#中计算、选择和更新嵌套元素
- python - GitStats 无法识别 Gnuplot (Windows)
- c - 试图打印一个 int 数组的元素,但我得到了一些奇怪的结果
- kubernetes-helm - 多个 Helm chart 和 parent chart 需要先执行,并在所有子 chart 完成后完成
- react-native - React-Native,全球状态?
- codenameone - Codenameone:在 iOS 上添加操作扩展
- c++ - 使用 RAW 套接字读取 ICMP 响应
- android - 如何从另一个活动中编辑和获取 editText 输入字段的更新?