1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/gh-pages-deploy.sh
Oliver Feldmann 0a58ad6e1c Deploy mkdocs when merging to master
Only changes to master and PRs starts the travis job.
On PR Maven tests and mkdocs build for warnings and error check is done.
On change on master Maven is **not** run and the documentation is built
and deployed using a deploy key. The encrypted deploy key is not part of
this commit, it needs to be provided by an admin for this repository.
2018-03-12 09:58:32 +01:00

16 lines
448 B
Bash
Executable File

#!/bin/bash
echo "Found change on master: Deployment of documentation"
PRIVATE_KEY="cfg/id_rsa"
chmod 600 "${PRIVATE_KEY}"
eval `ssh-agent -s`
ssh-add "${PRIVATE_KEY}"
git config user.name "Travis CI Publisher"
git remote add docu "git@github.com:$TRAVIS_REPO_SLUG.git";
git fetch docu gh-pages:gh-pages
echo "Pushing to gh-pages of repository $TRAVIS_REPO_SLUG"
cd $TRAVIS_BUILD_DIR/documentation
mkdocs gh-deploy -v --clean --remote-name docu