我正在使用compodoc为我的Angular项目生成文档。
现在,在将repo推送到Github之前,我正在手动生成文档(在我的本地)。/docs文件夹由github页面提供服务。将文档文件包括到提交中会使提交变得令人困惑。如果compodoc脚本可以在github中执行并在github中生成docs文件夹,那就太好了。
我知道Github不是一个用来构建代码的地方,但据我所知,你可以用Jeykll生成这样的工作流。有没有人解决过这样的问题?
发布于 2017-05-15 03:27:23
我是Compodoc的核心维护者。
请查看演示存储库:https://github.com/compodoc/compodoc-demo-todomvc-angular
这是一个很好的例子,说明了如何为生成的文档提供服务。这里有一个travis任务。查看travis.yml文件。
它首先运行npm doc任务,该任务运行compodoc。在此之后,启动部署脚本。
- npm run doc - bash ./deploy.sh
在这个部署脚本中,我只是移动到documentation文件夹,并提交gh-pages分支上的所有内容。
cd documentation git add . && \ git commit -m "Deploy to GitHub Pages" && \ git push --force "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
问候
发布于 2019-04-10 05:24:31
我在Jenkins的工作中做到了这一点:
git add docs && git commit -m "my commit message"
git push origin `git subtree split --prefix docs master`:gh-pages --force我在评论here中找到了答案
https://stackoverflow.com/questions/42946659
复制相似问题