我无法理解有关发布到github页面的一些基本说明。有一种新方法可以发布使用Angular Cli制作的Angular项目;我正在按照this page对新命令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]
我为我的项目创建了一个dist文件夹,然后运行ng构建代码。终端显示已渲染的所有块,但我找不到github页面的链接。我在github上查看我的存储库,就好像什么也没发生过一样。这是因为我需要cd到一个特定的文件夹来执行angular-cli-ghpages吗?这是我的repo,我非常感谢任何帮助。
答案 0 :(得分:4)
我成功地使用命令
推送到github页面angular-cli-ghpages --repo=https://github.com/parthghiya/testrepo.git --name=parthghiya --email=parth.ghiya@knowarth.com --no-silent
回购链接:https://github.com/parthghiya/testrepo
我做了ng build --prod --base href .
我做的步骤:
https://help.github.com/articles/connecting-to-github-with-ssh/
答案 1 :(得分:2)
删除了通过angular cli部署到github的选项。
答案 2 :(得分:1)
试试这个(对于mac):
$ npm install -g angular-cli-ghpages
将您的代码推送到github仓库,然后在终端中运行:ng build --env=prod --base-href "https://yourgithubusername.github.io/yourprojectname/"
此处
'命名为yourprojectname'是你的github仓库的名称,而不是你的本地
回购。
sudo angular-cli-ghpages
并输入密码。