我在一个名为 feat/demo-mode 的分支上对 Angular 存储库进行了许多更改,我想将此分支发布到 GitHub Pages。
在 GitHub Pages 部分下,我选择了我的分支,如下所示配置-a-publishing-source-for-your-github-pages-site。
我在 package.json 中添加/更新了以下脚本
"build": "ng build --prod --base-href /my-example-repo/",
"predeploy": "npm run build",
"deploy": "npx angular-cli-ghpages --dir=dist/my-example-repo --branch=feat/demo-mode --message='Deploy to GitHub Pages'"
当我运行npm run deploy
时,应用程序会构建和部署。我现在可以在 上访问它https://funfair-tech.github.io/my-example-repo/
,但是 feat/demo-mode 中的代码现在已替换为我的 dist 文件夹的内容。