Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 95de7ef

Browse files
committed
Auto deploy docs to github pages
1 parent 8fdba80 commit 95de7ef

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ project/plugins/project/
88
.cache
99
.lib/
1010
*.log
11+
/docs/
1112

1213
# MacOS
1314
.DS_Store

.scripts/update-docs.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
set -ev
3+
SCALA_MAJOR=$(echo $TRAVIS_SCALA_VERSION | grep '^\d+\.\d+' -o)
4+
5+
# Update the java-/scaladocs on https://github.com/codeoverflow-org/chatoverflow-gh-pages
6+
7+
echo "Configuring git..."
8+
git config --global user.email "travis@travis-ci.org"
9+
git config --global user.name "Travis CI"
10+
11+
echo "Cloning docs repo..."
12+
git clone https://${GH_TOKEN}@github.com/codeoverflow-org/chatoverflow-gh-pages docs
13+
14+
echo "Copying docs..."
15+
cp -fR target/scala-$SCALA_MAJOR/api chatoverflow
16+
17+
echo "Updating wiki..."
18+
19+
git commit --message "Deployed doc (Travis build #$TRAVIS_BUILD_NUMBER)"
20+
git push --force origin master

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
notifications:
2+
email: false
3+
branches:
4+
only:
5+
- master
6+
language: scala
7+
jdk: oraclejdk8
8+
scala:
9+
- 2.12.5
10+
cache:
11+
directories:
12+
- $HOME/.ivy2/cache
13+
- $HOME/.sbt
14+
before_cache:
15+
- rm -fv $HOME/.ivy2/.sbt.ivy.lock
16+
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
17+
- find $HOME/.sbt -name "*.lock" -print -delete
18+
script:
19+
- sbt ++$TRAVIS_SCALA_VERSION -Dfile.encoding=UTF8 doc
20+
- chmod +x .scripts/update-docs.sh
21+
- bash .scripts/update-docs.sh

0 commit comments

Comments
 (0)