git - Gitlab CI:作业配置应包含至少一项可见作业
问题描述
我已经开始在 Gitlab CI 上构建我的 .gitlab-ci.yml 所以我用这样的简单阶段创建它
image: node:alpine
variables:
PUBLIC_URL: /my-app
cache:
paths:
- node_modules
stages:
- build
- deploy
install_dependencies:
stage: build
script:
- npm install
artifacts:
paths:
- node_modules/
deploy_to_cloud:
stage: deploy
script:
- echo Deployed
但作业失败并回复:在您的 .gitlab-ci.yml 中发现错误:
“作业配置应至少包含一项可见作业”
解决方案
yml 中可能存在某种不可见的 BOM 或其他无效字符。尝试使用另一个编辑器对其进行验证以进行检查。如果您什么也没找到,请尝试删除该文件并使用另一种方法重新创建它。
推荐阅读
- typescript - 如何描述类的返回值?
- firebase - Firebase 云消息传递延迟
- c - 如何遍历链表并仅打印包含特定数据的内容,然后再次运行以打印包含 c 中其他数据的内容?
- sql-server - 如何使用子句将系统版本控制添加到此表定义中?
- regex - 使用正则表达式运算符 (=~) 时变量不扩展
- c# - c# 中的递归加载,我错过了什么?
- json - 返回值以记录时出现表达式错误
- javascript - 如何让一个函数为表格中的每个按钮工作
- bash - 使用 cat 和 echo 写入 /dev/ttyUSB0
- apache-spark - 将 Scalapb 与 spark 结构化流和 java 生成的 protobuf 类一起使用