

在Travis-CI中调用EGO自动更新博客
source link: https://www.lujun9972.win/blog/2019/04/25/%E5%9C%A8travis-ci%E4%B8%AD%E8%B0%83%E7%94%A8ego%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%96%B0%E5%8D%9A%E5%AE%A2/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

在Travis-CI中调用EGO自动更新博客
经过一番努力,总于把 EGO 改到可以无需人工介入自动更新博客了,现在只需要在 source
branch中加上两个文件:
.travis.yml
dist: xenial language: generic branches: only: - source git: depth: false quiet: true before_install: - git clone https://github.com/lujun9972/EGO ~/EGO - sudo add-apt-repository ppa:ubuntu-elisp/ppa -y - sudo apt-get update - sudo apt-get install emacs-snapshot -y - emacs-snapshot --version script: - git config --global core.quotepath false - export REPO=$(git remote -v |grep fetch |head -n 1|awk '{print $2}') - git clone -b source ${REPO} ~/source - git clone -b master ${REPO} ~/web - emacs-snapshot --batch -l ./auto_publish.el deploy: provider: pages skip_cleanup: true keep_history: true github_token: $GITHUB_TOKEN local_dir: /home/travis/web target_branch: master on: branch: - source
auto_publish.el
(require 'package) (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) (not (gnutls-available-p)))) (proto (if no-ssl "http" "https"))) (when no-ssl (warn "\ Your version of Emacs does not support SSL connections, which is unsafe because it allows man-in-the-middle attacks. There are two things you can do about this warning: 1. Install an Emacs version that does support SSL and be safe. 2. Remove this warning from your init file so you won't see it again.")) ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t) ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/"))))) (package-initialize) (package-refresh-contents) (package-install 'mustache) (package-install 'htmlize) (setq load-path (cons "~/EGO/" load-path)) (require 'log-edit) (require 'htmlize) (require 'ego) (setq ego-project-config-alist `(("blog" :repository-directory "~/source" :site-domain "https://lujun9972.github.io/" :site-main-title "暗无天日" :site-sub-title "=============>随便,谢谢" :theme (emacs_love) :summary (("years" :year :updates 10) ("authors" :authors) ("tags" :tags)) :source-browse-url ("Github" ,(getenv "REPO")) :personal-disqus-shortname "lujun9972" :personal-google-analytics-id "7bac4fd0247f69c27887e0d4e3aee41e" :ignore-file-name-regexp "README.org" :store-dir "~/web"))) (message "BEGIN TO AUTO PUBLIC") (setq org-export-use-babel nil) (setq debug-on-error t) (ego-do-publication "blog" nil nil nil)
根据自己的需求更改 auto_publish.el
中 ego-project-config-alist
的配置。
然后根据 这里步骤 创建一个repo权限的github token,再为travis-ci中的仓库添加一个名为 GITHUB_TOKEN
的变量,值就是新创建的github token,就可以了。
Recommend
-
13
My thoughts on coding, ego and attention. How I learned to get out of my own way by learning about this link between ego and attention. If being a good software engineer means being a good thinker, then...
-
5
博客折腾记:使用 Travis CI 自动部署 发表于 2018-05-28...
-
8
博客折腾记:使用 Travis CI 自动部署博客 发表于 2018-09-04...
-
8
Code interviews and ego fails 2021-01-28T17:00 I’ve had three code interviews in the last few months. In the first two, I did so badly that I lost any chance for the job, despite doing well on the other inter...
-
8
Articles: Ego is the Enemy 2017-06-16 A friend asked why I don’t write more often. I told her it’s my minimalism, not wanting to put anything into t...
-
6
EGO 56V lawn mower with two batteries $549, more
-
7
Ego, and 10 ways to keep it in check.An overactive self-identify: what it looks like in product management, how it affects you, and 10 ways to keep yours in check.
-
6
Cardano NFT Disruptor – EGO.COM Enters the Game
-
8
EGO.COM – An Iconic Cardano NFT Project is Gaining Momentum
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK