博客
关于我
使用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/

    你可能感兴趣的文章
    Node.js 文件系统的各种用法和常见场景
    查看>>
    Node.js 模块系统的原理、使用方式和一些常见的应用场景
    查看>>
    Node.js 的事件循环(Event Loop)详解
    查看>>
    node.js 简易聊天室
    查看>>
    Node.js 线程你理解的可能是错的
    查看>>
    Node.js 调用微信公众号 API 添加自定义菜单报错的解决方法
    查看>>
    node.js 配置首页打开页面
    查看>>
    node.js+react写的一个登录注册 demo测试
    查看>>
    Node.js中环境变量process.env详解
    查看>>
    Node.js之async_hooks
    查看>>
    Node.js初体验
    查看>>
    Node.js升级工具n
    查看>>
    Node.js卸载超详细步骤(附图文讲解)
    查看>>
    Node.js卸载超详细步骤(附图文讲解)
    查看>>
    Node.js基于Express框架搭建一个简单的注册登录Web功能
    查看>>
    node.js学习之npm 入门 —8.《怎样创建,发布,升级你的npm,node模块》
    查看>>
    Node.js安装与配置指南:轻松启航您的JavaScript服务器之旅
    查看>>
    Node.js安装及环境配置之Windows篇
    查看>>
    Node.js安装和入门 - 2行代码让你能够启动一个Server
    查看>>
    node.js安装方法
    查看>>