-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·35 lines (31 loc) · 937 Bytes
/
publish.sh
File metadata and controls
executable file
·35 lines (31 loc) · 937 Bytes
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
#!/bin/sh
setup_git() {
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis CI"
}
commit_website_files() {
git fetch origin
git checkout -b gh-pages
# remove all asciidoc (.adoc) source files
git ls-files | grep '\.adoc$' | xargs git rm --cached
# remove unneeded files
git rm .gitattributes
git rm .travis.yml
git rm publish.sh
# add & commit everything new
git add --all
git commit --message "Updated Documentation. [Travis build: $TRAVIS_BUILD_NUMBER] [skip ci]"
}
upload_files() {
# make sure we have a the Github Token
if [ -z $GH_TOKEN ]; then
echo "Please set your Github token as secret GH_TOKEN env var."
exit 1
fi
# git push
git remote add origin-pages https://${GH_TOKEN}@github.com/fifengine/fifengine-docs > /dev/null 2>&1
git push -f --set-upstream origin-pages gh-pages > /dev/null 2>&1
}
setup_git
commit_website_files
upload_files