-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.sh
executable file
·45 lines (32 loc) · 938 Bytes
/
deploy.sh
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
#!/bin/bash
set -o errexit -o nounset
rev=$(git rev-parse --short HEAD)
# clear and re-create the out directory
rm -rf out || exit 0;
mkdir out;
# RUN PANDOC and create HTML
for YEAR in 2* ; do
cd $YEAR
mkdir ../out/$YEAR
# copy whatever is in public to `out` directory
if [[ -n $(find public/ -type f -maxdepth 1) ]]; then
cp -r public/* ../out/$YEAR/
fi
for i in *md; do
if [[ $i != 'README.md' ]]; then
pandoc -f markdown_github -c public/theme.css -s $i -o ../out/$YEAR/${i%%md}html;
fi
done
cd ..
done
cd out
# Push contents of out to new gh-pages
git init
git config user.name "roddypr-travis"
git config user.email "[email protected]"
git remote add deploy "https://[email protected]/wurmlab/QMUL-MSc-Programming-in-R-and-Using-Linux.git"
git fetch deploy gh-pages
git reset deploy/gh-pages
git add -A .
git commit -m "build website at ${rev}"
git push deploy HEAD:gh-pages