Deploy Angular app to Surge using Travis CI
(I) Creating Angular CLI app and deploying to Surge
- Install angular cli using
npm install --save-dev @angular/cliand create a new project using
ng new <project-name>command.
- Install surge using
npm install --global surgeand create a surge account using the
- Now, you should see your first angular app deployed to surge.
(II) Integrating GitHub with Travis CI
- Login to Travis CI using your GitHub account.
- Generate a new surge token using
- Add the same token value to
SURGE_TOKENin Travis CI project's settings tab and also set the
SURGE_LOGINvalue as your surge email. Here is the image for reference.
4. To perform build, Travis CI looks for build configuration file
.travis.yml. Add the below
.travis.yml to your repository.
That’s all. Now, to kick-off with your first automatic build and deployment process, just make a small text change in your app and push the code changes to GitHub and the rest follows automatically.
Originally published at sairaghavak.blogspot.com on March 27, 2017.