Gitlab CI:作业配置应至少包含一个可见作业

问题描述 投票:0回答:1

我已经开始在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中发现错误:

“作业配置应至少包含一个可见作业”

git continuous-integration gitlab yaml gitlab-ci
1个回答
0
投票

您的yml中可能存在一些BOM表或其他无效字符,这些字符不可见。尝试使用其他编辑器对其进行验证以进行检查。如果未找到任何内容,请尝试删除该文件,然后使用另一种方法重新创建它。

© www.soinside.com 2019 - 2024. All rights reserved.