8000 Build markdown to index.html on TravisCI · shelljs/benchmarks@2c164c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c164c2

Browse files
committed
Build markdown to index.html on TravisCI
1 parent 8c61bb5 commit 2c164c2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ node_js: "5"
44
os:
55
- linux
66

7+
# So we can compile markdown
8+
addons:
9+
apt:
10+
packages:
11+
- pandoc
12+
713
# For deploying to Github pages
814
env:
915
global:

scripts/deploy.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@ require('../shelljs/0.6.0');
55
// This script is typically run by the CI
66
// GH_TOKEN must be an environmental variable
77

8+
var markdownFile = __dirname + '/index.md';
9+
810
set('-e');
911
if (env.GH_TOKEN) {
12+
console.log('Compiling markdown to HTML');
13+
14+
rm('-rf', 'build');
15+
mkdir('build');
16+
exec('pandoc index.md -f markdown -t html -s -o build/index.html');
17+
1018
console.log('Deploying to Github pages');
19+
cd('build');
20+
1121
exec('git config user.name "Travis CI"');
1222
exec('git config user.email "ntfschr@gmail.com"');
23+
24+
exec('git init');
1325
exec('git add .');
1426
exec('git commit -m "Deploy to Github pages"');
1527
var ret = exec('git push --force --quiet "https://${GH_TOKEN}@github.com/shelljs/benchmarks.git" master:gh-pages').code;

0 commit comments

Comments
 (0)
0