forked from ppoffice/hexo-theme-icarus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
54 lines (48 loc) · 1.6 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
language: node_js
os: linux
cache: false
node_js:
- "8"
- "node"
script:
- echo "Running tests against $(node -v) ..."
- export DEPS=$(node -e "const deps=require('./package.json').peerDependencies;console.log(Object.keys(deps).map(key=>key+'@'+deps[key]).join(' '));")
- npm install $DEPS
- npm run lint
jobs:
include:
- stage: github pages
node_js: "10"
git:
clone: false
script:
- echo "Publish site to github pages ..."
- git clone --recurse-submodules https://github.com/ppoffice/hexo-theme-icarus.git -b site $TRAVIS_BUILD_DIR
- cd $TRAVIS_BUILD_DIR/themes/icarus
- git fetch origin $TRAVIS_COMMIT && git merge $TRAVIS_COMMIT
- export DEPS=$(node -e "const deps=require('./package.json').peerDependencies;console.log(Object.keys(deps).map(key=>key+'@'+deps[key]).join(' '));")
- cd $TRAVIS_BUILD_DIR
- npm install -g hexo-cli
- npm install
- npm install $DEPS
- cp _config.theme.yml themes/icarus/_config.yml
- ([[ -e _config.page.yml ]] && cp _config.page.yml themes/icarus/) || true
- ([[ -e _config.post.yml ]] && cp _config.post.yml themes/icarus/) || true
- hexo g
deploy:
provider: pages
token: $GITHUB_TOKEN
keep_history: false
local_dir: public
skip_cleanup: true
on:
tags: true
- stage: github release
node_js: "10"
script: echo "Deploying to github release ..."
skip_cleanup: false
deploy:
provider: releases
token: $GITHUB_TOKEN
on:
tags: true