{"id":16687378,"url":"https://github.com/rodrigokamada/angular-travisci","last_synced_at":"2025-10-31T00:31:12.948Z","repository":{"id":62638047,"uuid":"371228398","full_name":"rodrigokamada/angular-travisci","owner":"rodrigokamada","description":"Application example built with Angular 16 and hosted on GitHub Pages using Travis CI.","archived":false,"fork":false,"pushed_at":"2023-10-09T22:37:04.000Z","size":7855,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T03:34:23.174Z","etag":null,"topics":["angular","beginners","dev-community","gh-pages","github","hacktoberfest","stackblitz","travis-ci","tutorial"],"latest_commit_sha":null,"homepage":"https://rodrigokamada.github.io/angular-travisci/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rodrigokamada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"rodrigokamada"}},"created_at":"2021-05-27T02:53:50.000Z","updated_at":"2023-10-13T13:27:29.000Z","dependencies_parsed_at":"2023-02-19T06:31:42.359Z","dependency_job_id":null,"html_url":"https://github.com/rodrigokamada/angular-travisci","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigokamada%2Fangular-travisci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigokamada%2Fangular-travisci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigokamada%2Fangular-travisci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigokamada%2Fangular-travisci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodrigokamada","download_url":"https://codeload.github.com/rodrigokamada/angular-travisci/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239084400,"owners_count":19578773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","beginners","dev-community","gh-pages","github","hacktoberfest","stackblitz","travis-ci","tutorial"],"created_at":"2024-10-12T15:08:58.453Z","updated_at":"2025-10-31T00:31:07.554Z","avatar_url":"https://github.com/rodrigokamada.png","language":"TypeScript","readme":"# Angular Travis CI\n\n\nApplication example built with [Angular](https://angular.io/) 16 and hosted on [GitHub Pages](https://pages.github.com/) using [Travis CI](https://www.travis-ci.com/).\n\nThis tutorial was posted on my [blog](https://rodrigo.kamada.com.br/blog/hospedando-uma-aplicacao-angular-no-github-pages-usando-o-travis-ci) in portuguese and on the [DEV Community](https://dev.to/rodrigokamada/hosting-an-angular-application-on-github-pages-using-travis-ci-5dip) in english.\n\n\n\n[![Website](https://shields.braskam.com/v1/shields?name=website\u0026format=rectangle\u0026size=small\u0026radius=5)](https://rodrigo.kamada.com.br)\n[![LinkedIn](https://shields.braskam.com/v1/shields?name=linkedin\u0026format=rectangle\u0026size=small\u0026radius=5)](https://www.linkedin.com/in/rodrigokamada)\n[![Twitter](https://shields.braskam.com/v1/shields?name=twitter\u0026format=rectangle\u0026size=small\u0026radius=5\u0026socialAccount=rodrigokamada)](https://twitter.com/rodrigokamada)\n[![Instagram](https://shields.braskam.com/v1/shields?name=instagram\u0026format=rectangle\u0026size=small\u0026radius=5)](https://www.instagram.com/rodrigokamada/)\n\n\n\n## Prerequisites\n\n\nBefore you start, you need to install and configure the tools:\n\n* [git](https://git-scm.com/)\n* [Node.js and npm](https://nodejs.org/)\n* [Angular CLI](https://angular.io/cli)\n* IDE (e.g. [Visual Studio Code](https://code.visualstudio.com/))\n\n\n\n## Getting started\n\n\n### Create and configure the account on the GitHub\n\n\n**1.** Let's create the account. Access the site [https://github.com/](https://github.com/) and click on the button *Sign up*.\n\n![GitHub - Initial page](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722987/Blog/angular-travisci/github-step1.png)\n\n**2.** Fill in the fields *Username*, *Email address*, *Password*, click on the button *Verify* to solve the challenge and click on the button *Create account*.\n\n![GitHub - Sign up](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722986/Blog/angular-travisci/github-step2.png)\n\n**3.** Let's generate the token that will be used in Travis CI. Click on the menu with the avatar and click on the menu *Settings*.\n\n![GitHub - Menu Settings](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722986/Blog/angular-travisci/github-step3.png)\n\n**4.** Click on the menu *Developer settings*.\n\n![GitHub - Settings](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722986/Blog/angular-travisci/github-step4.png)\n\n**5.** Click on the menu *Personal access tokens*.\n\n![GitHub - Developer settings](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722986/Blog/angular-travisci/github-step5.png)\n\n**6.** Click on the button *Generate new token*.\n\n![GitHub - Personal access tokens](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722986/Blog/angular-travisci/github-step6.png)\n\n**7.** Fill in the field *Note*, select the option *repo* and click on the button *Create token*.\n\n![GitHub - Generate new token](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722987/Blog/angular-travisci/github-step7.png)\n\n**8.** Copy the generated token and, in my case, the `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` token was generated because this token will be configured in Travis CI.\n\n![GitHub - Create token](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722987/Blog/angular-travisci/github-step8.png)\n\n**9.** Let's create the repository. Click on the menu with the avatar and click on the menu *Your repositories*.\n\n![GitHub - Menu Your repositories](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722987/Blog/angular-travisci/github-step9.png)\n\n**10.** Click on the button *New*.\n\n![GitHub - New repository](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722987/Blog/angular-travisci/github-step10.png)\n\n**11.** Fill in the field *Repository bane* and click on the button *Create repository*.\n\n![GitHub - Create repository](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722987/Blog/angular-travisci/github-step11.png)\n\n**12.** Ready! Account created, token generated and repository [`https://github.com/rodrigokamada/angular-travisci`](https://github.com/rodrigokamada/angular-travisci) created.\n\n![GitHub - Repository created](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722988/Blog/angular-travisci/github-step12.png)\n\n\n### Create and configure the account on the Travis CI\n\n\n**1.** Let's create the account. Access the site [https://travis-ci.com/](https://travis-ci.com/) and click on the button *Sign up*.\n\n![Travis CI - Initial page](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722988/Blog/angular-travisci/travisci-step1.png)\n\n**2.** Click on the button *SIGN IN WITH GITHUB* to sign in with GitHub account.\n\n![Travis CI - Sign up](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722988/Blog/angular-travisci/travisci-step2.png)\n\n**3.** If Travis CI requests permission to list the GitHub repositories, accept the request. Click on the repository link *angular-travisci*.\n\n![Travis CI - List repositories](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722988/Blog/angular-travisci/travisci-step3.png)\n\n**4.** Let's set up the GitHub access token. Click on the menu *More options* and click on the menu *Settings*.\n\n![Travis CI - Repository](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722988/Blog/angular-travisci/travisci-step4.png)\n\n**5.** Fill in the fields *NAME* with the value *GITHUB_TOKEN*, *VALUE* with the value of your token generated on GitHub and click on the button *Add*.\n\n![Travis CI - Settings](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722988/Blog/angular-travisci/travisci-step5.png)\n\n**6.** Ready! Account created and repository configured.\n\n![Travis CI - Repository configured](https://res.cloudinary.com/rodrigokamada/image/upload/v1636722989/Blog/angular-travisci/travisci-step6.png)\n\n\n### Create the Angular application\n\n\n**1.** Let's create the application with the Angular base structure using the `@angular/cli` with the route file and the SCSS style format.\n\n```shell\nng new angular-travisci\n? Would you like to add Angular routing? Yes\n? Which stylesheet format would you like to use? SCSS   [ https://sass-lang.com/documentation/syntax#scss                ]\nCREATE angular-travisci/README.md (1061 bytes)\nCREATE angular-travisci/.editorconfig (274 bytes)\nCREATE angular-travisci/.gitignore (604 bytes)\nCREATE angular-travisci/angular.json (3267 bytes)\nCREATE angular-travisci/package.json (1078 bytes)\nCREATE angular-travisci/tsconfig.json (783 bytes)\nCREATE angular-travisci/.browserslistrc (703 bytes)\nCREATE angular-travisci/karma.conf.js (1433 bytes)\nCREATE angular-travisci/tsconfig.app.json (287 bytes)\nCREATE angular-travisci/tsconfig.spec.json (333 bytes)\nCREATE angular-travisci/src/favicon.ico (948 bytes)\nCREATE angular-travisci/src/index.html (301 bytes)\nCREATE angular-travisci/src/main.ts (372 bytes)\nCREATE angular-travisci/src/polyfills.ts (2820 bytes)\nCREATE angular-travisci/src/styles.scss (80 bytes)\nCREATE angular-travisci/src/test.ts (743 bytes)\nCREATE angular-travisci/src/assets/.gitkeep (0 bytes)\nCREATE angular-travisci/src/environments/environment.prod.ts (51 bytes)\nCREATE angular-travisci/src/environments/environment.ts (658 bytes)\nCREATE angular-travisci/src/app/app-routing.module.ts (245 bytes)\nCREATE angular-travisci/src/app/app.module.ts (393 bytes)\nCREATE angular-travisci/src/app/app.component.scss (0 bytes)\nCREATE angular-travisci/src/app/app.component.html (23809 bytes)\nCREATE angular-travisci/src/app/app.component.spec.ts (1087 bytes)\nCREATE angular-travisci/src/app/app.component.ts (221 bytes)\n✔ Packages installed successfully.\n```\n\n**2.** Create the `.travis.yml` file.\n\n```shell\ntouch .travis.yml\n```\n\n**3.** Configure the `.travis.yml` file with the content below.\n\n```yaml\nnotifications:\n  email:\n    recipients:\n      - rodrigo@kamada.com.br\n\nlanguage: node_js\n\nnode_js:\n  - 16\n\nbefore_script:\n  - npm install\n\nscript:\n  - npm run test:headless\n\nbefore_deploy:\n  - npm run build:prod\n\ndeploy:\n  provider: pages\n  skip_cleanup: true\n  github_token: $GITHUB_TOKEN\n  local_dir: dist/angular-travisci\n  on:\n    branch: main\n```\n\n**4.** Change the `package.json` file and add the scripts below. Replace the `rodrigokamada` value with your GitHub username.\n\n```json\n  \"build:prod\": \"ng build --prod --base-href https://rodrigokamada.github.io/angular-travisci/\",\n  \"test:headless\": \"ng test --watch=false --browsers=ChromeHeadless\"\n```\n\n**5.** Change the `src/app/app.component.spec.ts` file and remove the tests `should have as title 'angular-travisci'` and `should render title`.\n\n**6.** Run the test with the command below.\n\n```shell\nnpm run test:headless\n\n\u003e angular-travisci@1.0.0 test:headless\n\u003e ng test --watch=false --browsers=ChromeHeadless\n\n⠋ Generating browser application bundles (phase: setup)...Compiling @angular/core/testing : es2015 as esm2015\nCompiling @angular/platform-browser/testing : es2015 as esm2015\nCompiling @angular/compiler/testing : es2015 as esm2015\nCompiling @angular/common/testing : es2015 as esm2015\nCompiling @angular/router/testing : es2015 as esm2015\nCompiling @angular/platform-browser-dynamic/testing : es2015 as esm2015\n⠹ Generating browser application bundles (phase: building)...06 06 2021 21:22:49.870:INFO [karma-server]: Karma v6.3.3 server started at http://localhost:9876/\n06 06 2021 21:22:49.872:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited\n06 06 2021 21:22:49.875:INFO [launcher]: Starting browser ChromeHeadless\n✔ Browser application bundle generation complete.\n06 06 2021 21:22:54.562:INFO [Chrome Headless 91.0.4472.77 (Linux x86_64)]: Connected on socket SvdczBWd9ENbliBLAAAB with id 49624818\nChrome Headless 91.0.4472.77 (Linux x86_64): Executed 1 of 1 SUCCESS (0.059 secs / 0.036 secs)\nTOTAL: 1 SUCCESS\n```\n\n**7.** Run the application with the command below. Access the URL `http://localhost:4200/` and check if the application is working.\n\n```shell\nnpm start\n\n\u003e angular-travisci@1.0.0 start\n\u003e ng serve\n\n✔ Browser application bundle generation complete.\n\nInitial Chunk Files | Names         |      Size\nvendor.js           | vendor        |   2.38 MB\npolyfills.js        | polyfills     | 128.56 kB\nmain.js             | main          |   8.93 kB\nruntime.js          | runtime       |   6.59 kB\nstyles.css          | styles        | 118 bytes\n\n                    | Initial Total |   2.52 MB\n\nBuild at: 2021-06-07T00:23:57.046Z - Hash: 0ddc925fb2029ab1452c - Time: 8963ms\n\n** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **\n\n\n✔ Compiled successfully.\n```\n\n**8.** Build the application with the command below.\n\n```shell\nnpm run build:prod\n\n\u003e angular-travisci@1.0.0 build:prod\n\u003e ng build --configuration production --base-href https://rodrigokamada.github.io/angular-travisci/\n\n✔ Browser application bundle generation complete.\n✔ Copying assets complete.\n✔ Index html generation complete.\n\nInitial Chunk Files           | Names         |      Size\nmain.c678fa8750e7c769.js      | main          | 177.63 kB\npolyfills.6d7801353e02e327.js | polyfills     |  36.21 kB\nruntime.b136bda8a38c4f2e.js   | runtime       |   1.06 kB\nstyles.ef46db3751d8e999.css   | styles        |   0 bytes\n\n                              | Initial Total | 214.90 kB\n\nBuild at: 2021-09-05T22:42:19.525Z - Hash: 83bfffc079b083727ca4 - Time: 26030ms\n```\n\n**9.** Syncronize the application on the GitHub repository that was created.\n\n**10.** Ready! After synchronizing the application on the GitHub repository, Travis CI build the application and synchronize on the branch `gh-pages`. Access the URL [https://rodrigokamada.github.io/angular-travisci/](https://rodrigokamada.github.io/angular-travisci/) and check if the application is working. Replace the `rodrigokamada` value with your GitHub username.\n\n\n\n## Cloning the application\n\n**1.** Clone the repository.\n\n```shell\ngit clone git@github.com:rodrigokamada/angular-travisci.git\n```\n\n**2.** Install the dependencies.\n\n```shell\nnpm ci\n```\n\n**3.** Run the application.\n\n```shell\nnpm start\n```\n","funding_links":["https://github.com/sponsors/rodrigokamada"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigokamada%2Fangular-travisci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodrigokamada%2Fangular-travisci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigokamada%2Fangular-travisci/lists"}