Push the generated site to gh-pages branch

This commit is contained in:
Andreas Dangel
2018-05-31 12:41:00 +02:00
parent 9391483180
commit cce2ede528

View File

@ -36,4 +36,24 @@ if [[ "${VERSION}" == *-SNAPSHOT && "${TRAVIS_BRANCH}" == "master" ]]; then
travis_wait rsync -ah --stats --delete pmd-doc-${VERSION}/ ${PMD_SF_USER}@web.sourceforge.net:/home/project-web/pmd/htdocs/snapshot/
fi
#
# Push the generated site to gh-pages branch
#
if [[ "${VERSION}" == *-SNAPSHOT && "${TRAVIS_BRANCH}" == "master" ]]; then
git config user.name "Travis CI (pmd-bot)"
git config user.email "andreas.dangel+pmd-bot@adangel.org"
git clone --branch gh-pages --depth 1 git@github.com:pmd/pmd.git pmd-gh-pages
# clear the files first
rm -rf pmd-gh-pages/*
# copy the new site
cp -a pmd-doc-${VERSION}/* pmd-gh-pages/
(
cd pmd-gh-pages
git add -A
git commit -m "Update documentation"
git push git@github.com:pmd/pmd.git HEAD:gh-pages
)
fi
popd