forked from zalando/restful-api-guidelines
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtravis_deploy.sh
More file actions
executable file
·24 lines (21 loc) · 892 Bytes
/
travis_deploy.sh
File metadata and controls
executable file
·24 lines (21 loc) · 892 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
#!/usr/bin/env bash
# This script runs on Travis CI and deploy the generated files to gh-pages branch of the repository iff it's triggered
# by a merge into the master branch
set -ex
USER="ZalandoGhPages"
EMAIL="no-reply@zalando.de"
DEPLOY_MESSAGE="Deploy to GitHub Pages (auto)"
GH_REPO="github.com/zalando/restful-api-guidelines.git"
if [[ "${TRAVIS}" = "true" && "${TRAVIS_SECURE_ENV_VARS}" = "true" && "${TRAVIS_PULL_REQUEST}" = "false" && "${TRAVIS_BRANCH}" = "master" ]]; then
echo "Deploying to gh-pages branch"
cd output
git init
git config user.name "${USER}"
git config user.email "${EMAIL}"
git add -A
git commit -m "${DEPLOY_MESSAGE}"
git push --force --quiet "https://${GH_TOKEN}@${GH_REPO}" master:gh-pages
echo "Deployed successfully to gh-pages branch"
else
echo "It's not an update of the master branch, skipping the deployment"
fi