如何发布到github页面?

st4*_*gut 5 github-pages angular-cli angular

我无法理解有关发布到github页面的一些基本指令.有一种新方法可以发布使用Angular Cli制作的Angular项目; 我按照新页面上的指示操作,angular-cli-ghpages:

Execute angular-cli-ghpages in order to deploy the project with a build from dist folder.
Note: you have to create the dist folder in before (e.g. ng build --prod)

Usage:

ng build --prod --base-href "https://USERNAME.github.io/REPOSITORY/"
angular-cli-ghpages [OPTIONS]
Run Code Online (Sandbox Code Playgroud)

我为我的项目创建了一个dist文件夹,然后运行ng构建代码.终端显示已渲染的所有块,但我找不到github页面的链接.我在github上查看我的存储库,就好像什么也没发生过一样.这是因为我需要cd到一个特定的文件夹来执行angular-cli-ghpages吗?这是我的回购,我非常感谢任何帮助.

Par*_*iya 4

我成功地使用命令推送到 github 页面

angular-cli-ghpages --repo=https://github.com/parthghiya/testrepo.git --name=parthghiya --email=parth.ghiya@knowarth.com --no-silent
Run Code Online (Sandbox Code Playgroud)

回购链接: https: //github.com/parthghiya/testrepo

我做到了ng build --prod --base href .

我所做的步骤:

  1. 生成我的 SSH 并添加它。

https://help.github.com/articles/connecting-to-github-with-ssh/

  1. 执行了推送命令。

在此输入图像描述

编辑 :

添加多个文件夹

创建与资产平行的文件夹,我创建了 2 个文件夹 Parth 和 Ghiya。然后在angular-cli.json中添加以下条目

"assets": [
        "assets","parth","ghiya",
        "favicon.ico",
        "manifest.json"
      ],
Run Code Online (Sandbox Code Playgroud)

所以 dist 文件夹现在包含 3 个文件夹,即 asset、parth 和 ghiya。然后像之前一样执行上面的push命令。