为Github项目添加Travis持续集成服务

参考链接:https://www.jianshu.com/p/3b8d86f25ee2
http://www.ruanyifeng.com/blog/2017/12/travis_ci_tutorial.html

以下为个人修改

1. 添加Github Pages(https://docs.travis-ci.com/user/deployment/pages/)搜索gh-pages即可得到该链接

deploy:
  provider: pages
  skip_cleanup: true
  github_token: $GITHUB_TOKEN  # Set in the settings page of your repository, as a secure variable
  keep_history: true
  on:
    branch: master

这里的$GITHUB_TOKEN 是在GitHub配置的personal token(设置token链接:https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line

由于这个是私密token,可以采用文档提及的两种方式之一,通过在travis配置环境变量来获取

猜你喜欢

转载自www.cnblogs.com/luguiqing/p/11711018.html