らいふうっどの閑話休題

興味のあることをゆる~く書いていく

ng deploy memo

f:id:ic_lifewood:20190914154053p:plain ng コマンドに deploy が追加されたので試してみれました。
I tried it because deploy was added to the ng command.

リポジトリ作成 / Create Repository

f:id:ic_lifewood:20190914154046p:plain

プロジェクト作成 / Create Angular Project

f:id:ic_lifewood:20190914154125g:plain

angular-cli-ghpagesを追加 / add angular-cli-ghpages

    "angular-cli-ghpages": "^0.6.0",

f:id:ic_lifewood:20190914154201g:plain

スクリプト追加 / add script

    "build": "ng build --prod",
    "deploy": "ng deploy --base-href=/ng-deploy-sample/",

f:id:ic_lifewood:20190914154302p:plain

ng ビルド実行 / excute ng build

f:id:ic_lifewood:20190914154332g:plain

ng デプロイ実行 / excute ng deploy

f:id:ic_lifewood:20190914154406g:plain

ブランチ

デプロイコマンドが実行されると、 gh-pages というブランチが作成されます。
When the deploy command is executed, a branch called gh-pages is created. f:id:ic_lifewood:20190914154459p:plain f:id:ic_lifewood:20190914154524p:plain

リポジトリ設定 / repository setting

リポジトリ設定へ移動します。/ Navigate to repository settings. f:id:ic_lifewood:20190914154542p:plain

GitHub Page

Sourceのプルダウンが、 gh-pages branch になっていれば、公開されています。
If the Source pull-down is in the gh-pages branch, it is open. f:id:ic_lifewood:20190914154647p:plain

デプロイコマンドの結果 / Result of Deploy command

https://gurezo.github.io/ng-deploy-sample/ f:id:ic_lifewood:20190914154719p:plain

サンプルコード github.com

for referrence