Yaml Travis CI构建应用程序,但不';t部署到sweep.sh

Yaml Travis CI构建应用程序,但不';t部署到sweep.sh,yaml,travis-ci,Yaml,Travis Ci,每次我将代码推送到github时,我都试图构建/部署angular应用程序。travis CI构建通过,但由于某些原因,它没有部署到激增。我在存储库设置中添加了SURGE\u LOGIN和SURGE\u TOKEN环境变量,但仍然不起作用。它是否应该在构建日志中提到部署失败?你知道这里出了什么问题/我如何解决?此外,当构建通过/失败时,我不会收到电子邮件,即使这是在配置文件中设置的,并且我的电子邮件地址添加到了浪涌_登录环境变量中 the end of my travis build log:

每次我将代码推送到github时,我都试图构建/部署angular应用程序。travis CI构建通过,但由于某些原因,它没有部署到激增。我在存储库设置中添加了SURGE\u LOGIN和SURGE\u TOKEN环境变量,但仍然不起作用。它是否应该在构建日志中提到部署失败?你知道这里出了什么问题/我如何解决?此外,当构建通过/失败时,我不会收到电子邮件,即使这是在配置文件中设置的,并且我的电子邮件地址添加到了浪涌_登录环境变量中

the end of my travis build log:

42.29s$ ng build -prod

1439
Date: 2017-11-02T11:04:25.130Z

1440
Hash: 5dadab3e49327d48aac1

1441
Time: 38060ms

1442
chunk {0} polyfills.d8d3d78a4deb2ab66856.bundle.js (polyfills) 66.1 kB {4} [initial] [rendered]

1443
chunk {1} styles.4d93494871bdc47b353f.bundle.css (styles) 115 kB {4} [initial] [rendered]

1444
chunk {2} main.725afabe80d80f10fd14.bundle.js (main) 8.08 kB {3} [initial] [rendered]

1445
chunk {3} vendor.4400ceca3ce00f041a26.bundle.js (vendor) 434 kB [initial] [rendered]

1446
chunk {4} inline.fe3295955bbd9314430c.bundle.js (inline) 1.45 kB [entry] [rendered]

1447

1448

1449
The command "ng build -prod" exited with 0.

1450

1451
Done. Your build exited with 0.


my .travis.yml code:

#travis CI build configuration

#build language

language: node_js

#node_js versions

node_js:
- "6.11.2"

#before running the build

before-script:
- npm install #install all dependencies

- npm install -g surge #global surge install

#actual build step
script: 
- ng build -prod

#build only on push not on pull requests.

deploy:
provider: surge
skip_cleanup: true
project: ./dist/  #build output path

domain: gaping-feeling.surge.sh  #surge domain

#notifications

notifications:
email:
on_success: change #default: change

on_failure: change #default: change

您的问题是yaml缩进。Yaml是压痕特异性的。所以

a:
b:

它们都有不同的含义。在第一种情况下,
a
b
是顶级属性,在后一种情况下,
b
a
的子属性。你的yaml应该是

#travis CI build configuration

#build language

language: node_js

#node_js versions

node_js:
- "6.11.2"

#before running the build

before-script:
- npm install #install all dependencies

- npm install -g surge #global surge install

#actual build step
script: 
- ng build -prod

#build only on push not on pull requests.

deploy:
  provider: surge
  skip_cleanup: true
  project: ./dist/  #build output path
  domain: gaping-feeling.surge.sh  #surge domain

notifications:
  email:
    on_success: change 
    on_failure: change

如果你仍然面临问题,请告诉我。但这应该能解决问题

谢谢@Tarun Lalwani的努力。你知道为什么travis CI没有在构建日志中显示部署失败吗?很可能是因为yaml有效,而部署选项为空。因此,该场景没有问题。空部署意味着没有部署
#travis CI build configuration

#build language

language: node_js

#node_js versions

node_js:
- "6.11.2"

#before running the build

before-script:
- npm install #install all dependencies

- npm install -g surge #global surge install

#actual build step
script: 
- ng build -prod

#build only on push not on pull requests.

deploy:
  provider: surge
  skip_cleanup: true
  project: ./dist/  #build output path
  domain: gaping-feeling.surge.sh  #surge domain

notifications:
  email:
    on_success: change 
    on_failure: change