Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit61e548a

Browse files
committed
update travis.yml
1 parentfe1bac3 commit61e548a

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

‎.travis.yml‎

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,37 @@ cache: npm
66
branches:
77
only:
88
-hexo# build hexo branch only
9+
# script:
10+
# - hexo generate # generate static files
11+
# deploy:
12+
# provider: pages
13+
# skip-cleanup: true
14+
# github-token: $GH_TOKEN
15+
# keep-history: true
16+
# on:
17+
# branch: master
18+
# all_branches: true # solve a permission problem
19+
# target_branch: master
20+
# local-dir: public
21+
22+
before_install:
23+
# - npm install -g hexo-cli
24+
25+
# Start: Build Lifecycle
26+
install:
27+
-npm install
28+
-npm install hexo-deployer-git --save
29+
30+
# 执行清缓存,生成网页操作
931
script:
10-
-hexogenerate# generate static files
11-
deploy:
12-
provider:pages
13-
skip-cleanup:true
14-
github-token:$GH_TOKEN
15-
keep-history:true
16-
on:
17-
branch:master
18-
all_branches:true# solve a permission problem
19-
target_branch:master
20-
local-dir:public
32+
-hexoclean
33+
-hexo generate
34+
35+
# 设置git提交名,邮箱;替换真实token到_config.yml文件,最后depoy部署
36+
after_script:
37+
-git config user.name "coderhaotf"
38+
-git config user.email "2415156870@qq.com"
39+
# 替换同目录下的_config.yml文件中gh_token字符串为travis后台刚才配置的变量,注意此处sed命令用了双引号。单引号无效!
40+
-sed -i "s/gh_token/${GH_TOKEN}/g" ./_config.yml
41+
-hexo deploy
42+
# End: Build LifeCycle

‎_config.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,7 @@ feed:
107107
## Docs: https://hexo.io/docs/deployment.html
108108
deploy:
109109
type:'git'
110-
repo:'https://github.com/coderhaotf/coderhaotf.github.io.git'
110+
# repo: 'https://github.com/coderhaotf/coderhaotf.github.io.git'
111+
# 下方的gh_token会被.travis.yml中sed命令替换
112+
repo:https://gh_token@github.com/coderhaotf/coderhaotf.github.io.git
111113
branch:'master'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp