billryan / algorithm-exercise

Data Structure and Algorithm notes. 数据结构与算法/leetcode/lintcode题解/

Home Page:https://algorithm.yuanbin.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deploy static files(PDF, EPUB, MOBI) in GitHub and GitCafe

billryan opened this issue · comments

Static files such as PDF are deployed in Gitbook and my DigitalOcean VPS, but it is a bit complex to maintain the scripts and difficult to access from mainland China.

The new architecture will be:

  • GitHub: source markdown files and static files output(another branch)
  • Travis CI: compile and deploy server
  • GitCafe: mirror of GitHub(speed up for mainland China)
  • Gitbook: html webpages

目前的 PDF 静态文件是通过自己的 VPS 和 Travis 编译输出的,实测自己的 VPS 性能还是比不过 Travis. 使用思源黑体后 PDF 占用字节空间达30MB+, 国内用户访问这些国外网站速度都非常慢,放在七牛云存储上的文件因为流量太大把我的免费额度快用完了... 因此想将静态文件直接放到 GitHub(主要用于国外用户) 和 GitCafe(镜像 GitHub 并主要用于服务国内用户),为避免污染 master 分支,这些静态文件输出都将放到另一个分支。

Reference

DONE

新的GitCafe 节点对于大陆用户加速至少10倍以上,力荐!

  1. EPUB: GitHub, Gitbook, GitCafe(**大陆用户适用) - 适合在 iPhone/iPad/MAC 上离线查看,实测效果极好。
  2. PDF: GitHub, Gitbook, GitCafe(**大陆用户适用) - 推荐下载GitHub 和 GitCafe 的版本,Gitbook 官方使用的中文字体有点问题。
  3. MOBI: GitHub, Gitbook, GitCafe(**大陆用户适用) - Kindle 专用,未测试,感觉不适合在 Kindle 上看此类书籍,尽管 Kindle 的屏幕对眼睛很好...

Travis 部分暂未迁移到新平台,因为我不确定基于容器的新平台对于重 sudo 依赖的任务是否方便,以后再研究研究。

所有静态文件编译输出均放在 deploy 分支,使用 ssh deploy 的方式,需要首先将私钥文件上传至 travis, 然后使用 openssl 解密,这里有很多细节,详见 .travis.yml 昨天的迁移费了我老大的劲了。 :(