Travis CI builds app but doesn't deploy to Surge.sh

user2094257

I am trying to build/deploy an angular app everytime I push my code to github. The travis CI build passes but it doesn't deploy to Surge for some reason. I added SURGE_LOGIN and SURGE_TOKEN environment variables to the repository settings but it still doesn't work. Should it not mention that deployment failed in the build log? Any idea what is going wrong here/how I can fix this? Also I don't get emails when a build passes/fails even though this is set in the config file and my email address i added to the SURGE_LOGIN environment variable

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
Tarun Lalwani

Your issue is the yaml indentation. Yaml is indentation specific. So

a:
b:

and

a:
  b:

They both have different meaning. In first a and b are top level attributes which in later case b is a child attribute of a. Your yaml should be

#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

If you still face issues let me know. But this should fix the problem

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related