博客
关于我
使用Travis+github+hexo持续部署博客项目
阅读量:124 次
发布时间:2019-02-26

本文共 2121 字,大约阅读时间需要 7 分钟。

GitHub?Hexo ? Travis CI ??????

???? GitHub ???????????

????? GitHub ? Travis CI????????? GitHub ?????????????????????

  • ?? GitHub ????? GitHub?????????????????????????????????????????????????

  • ??????????? GitHub ????????????????? > ??????? > ??????????????????????????????????????????????????

  • ???? Hexo ??????

    Hexo ?????????????????????????????????????

  • ?? Hexo????????????

    npm install -g hexo
  • ??? Hexo ?????????????

    hexo init

    ??????????????? Hexo ?????

  • ????? GitHub???????????? GitHub ??????

    git add .git commit -m "??? Hexo ??"git push origin master:gh-pages

    ???gh-pages ??????? GitHub Pages ??????????????????? master ???

  • ???? Travis CI ????

    Travis CI ????????CI???????????????????? Travis CI ????

  • ?? Travis CI??? Travis CI????Sign in with GitHub???? GitHub ?????

  • ?? GitHub ??????????? GitHub ?????? ellipse???????????????????????????????? master ????

  • ?? GitHub ???? Travis CI ????????????????????????? GitHub ???

  • ?? .travis.yml ?????????????? .travis.yml ??????????

    language: node_jsnode_js: '11'install: npm installscript: hexo gafter_script: echo "??? GitHub Pages"cd publicgit initgit config user.name "????"git config user.email "????"git add .git commit -m "????"git push -u -f "https://${TOKEN}@github.com/${USERNAME}/hexo_blog.git" master:gh-pagesbranches: only: master

    ? ${TOKEN} ????? GitHub ???${USERNAME} ????? GitHub ???

  • ?? Travis CI?? GitHub ??????????? Travis CI ????????????? Travis CI ??????????

  • ???? Hexo ??

    ??????????????? GitHub Pages?????? Hexo ??????????????? _config.yml ??????????

    url: https://yourusername.github.io/hexo_blogroot: /hexo_blog/

    ? yourusername ????? GitHub ????

    ???????

    ???????Travis CI ????????????????? GitHub Pages????????

  • ????????
    git add .git commit -m "????"git push origin master:gh-pages
  • Travis CI ???Travis CI ?????????? Hexo ????????????? GitHub Pages?
  • ????????

    ?????????? GitHub ??????? > ??????????????????????????https://<yourusername>.github.io/hexo_blog/

    ????

    • ???????? GitHub ????????????????????????????????
    • ????????????? npm??????Travis CI ???????????????
    • ???????????????? .travis.yml ????????????????????????

    ?????????????????????????????????????????? GitHub Pages?

    转载地址:http://zevf.baihongyu.com/

    你可能感兴趣的文章
    PHP语言最优雅的支付SDK扩展包
    查看>>
    PHP请求https域名发生segment fault段错误
    查看>>
    PHP读写XML文件
    查看>>
    PHP读写XML文件
    查看>>
    R&Python Data Science 系列:数据处理(3)
    查看>>
    php读取xml 数据库字段超长处理
    查看>>
    php课程 12-40 抽象类的作用是什么
    查看>>
    php课程 4-16 数组自定义函数(php数组->桶)
    查看>>
    PHP调用接口用post方法传送json数据
    查看>>
    php转化IP为整形
    查看>>
    php输出数据到csv文件
    查看>>
    php输出语句
    查看>>
    php运行原理详细说明
    查看>>
    php运行环境出现Undefined index 或variable时解决方法
    查看>>
    php进程通信
    查看>>
    R&Python Data Science 系列:数据处理(2)
    查看>>
    php递归算法总结
    查看>>
    PHP递归遍历文件夹
    查看>>
    R&Python Data Science 系列:数据处理(1)
    查看>>
    php错误日志文件
    查看>>