Angular-cli: How to deploy an app to githubpages

Created on 30 Aug 2016  路  8Comments  路  Source: angular/angular-cli

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Mac OSX El Capitan
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.11-webpack.8
    node: 6.4.0
    os: darwin x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    Just made a fresh project using ng new
    I tried ng github-pages:deploy but error says no angular-cli-build.js was found.
    if i run ng build --prod same error
    Then in the docs i saw that angular-cli-build.js was removed
    In the docs i saw to run npm install --save-dev angular-cli@webpack after ng new so i did it and now it gives me error Cannot find module './models/config

Please guide how to make a fresh project and deploy to github

Most helpful comment

Ok, thanks. I got it working also.

I wrote instructions to myself:

create a repository ex. test-repository
on command line:
ng new test-repository
cd project
npm install
ng build 鈥損rod (this will create gh-pages branch)
git remote add origin https://github.com/xxxx/test-repository.git
git push -u origin master
ng github-pages:deploy --skip-build

after all that, you will end up with two branches:
master
and
gh-pages

  • is used to create working github-pages stuff

gh-pages branch can be seen on settings tab of the repository

All 8 comments

Pls check #1854 workaround

I am getting this error after giving token and username
Failed to create GitHub repo. Error: 422 Unprocessable Entity

I get the very same error with:

angular-cli: 1.0.0-beta.10
node: 6.5.0
os: win32 x64

Failed to create GitHub repo. Error: 422 Unprocessable Entity

@jasugh , I got it working by following these steps

  1. After facing this issue i opened my github and there was a repository created for this project
  2. I followed the steps on that readme file by running commands on my project terminal
  3. I tried again ng github-pages:deploy and this solved my problem.
    The code was in the repository and was accessible on live url.

Ok, thanks. I got it working also.

I wrote instructions to myself:

create a repository ex. test-repository
on command line:
ng new test-repository
cd project
npm install
ng build 鈥損rod (this will create gh-pages branch)
git remote add origin https://github.com/xxxx/test-repository.git
git push -u origin master
ng github-pages:deploy --skip-build

after all that, you will end up with two branches:
master
and
gh-pages

  • is used to create working github-pages stuff

gh-pages branch can be seen on settings tab of the repository

Fixed in https://github.com/angular/angular-cli/pull/1633/files#diff-a7ba0adbb6fe6918c418062849f4f412

It was removed from angular-cli.
Use https://github.com/angular-buch/angular-cli-ghpages :
Install:

npm i -g angular-cli-ghpages

Deploy:

ng build --prod
ngh

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brtnshrdr picture brtnshrdr  路  3Comments

ericel picture ericel  路  3Comments

NCC1701M picture NCC1701M  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments