forked from fossasia/open-event-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush_api_docs.sh
More file actions
34 lines (28 loc) · 1.11 KB
/
push_api_docs.sh
File metadata and controls
34 lines (28 loc) · 1.11 KB
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
# pushes API docs to gh-pages on successful build
#
#!/bin/sh
set -e
git config --global user.name "Travis CI"
git config --global user.email "noreply+travis@fossasia.org"
# export DEPLOY_BRANCH=${DEPLOY_BRANCH:-master}
export DEPLOY_BRANCH='development' # TODO change before merging to dev
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_REPO_SLUG" != "fossasia/open-event-server" -o "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]; then
echo "We update docs only from master. So, let's skip this shall we ? :)"
exit 0
fi
# set ssh
openssl aes-256-cbc -K $encrypted_512f7587e087_key -iv $encrypted_512f7587e087_iv -in ./scripts/opev_orga.enc -out deploy_key -d
chmod 600 deploy_key
eval `ssh-agent -s`
ssh-add deploy_key
# clone and do
git clone -b gh-pages "git@github.com:fossasia/open-event-server.git" gh-pages
rm -rf gh-pages/api/v1/*
aglio --theme-full-width --theme-variables slate -i docs/api/api_blueprint.apib -o gh-pages/api/v1/index.html
cp -R docs/general/* gh-pages/_docs/
cp -R docs/installation/* gh-pages/_installation/
cd gh-pages
git add .
git commit -m '[Auto] Updated API Docs'
git push origin gh-pages
exit 0