deploy-phpdoc.sh 1.2 KB

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. # Modified from: https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
  3. # Exit with nonzero exit code if anything fails
  4. set -e
  5. # Clone Pico, then create & checkout gh-pages branch
  6. git clone -b gh-pages "https://github.com/picocms/Pico.git $TRAVIS_BUILD_DIR/build/Pico"
  7. # Inside this git repo we'll pretend to be a new user
  8. git config user.name "Travis CI"
  9. git config user.email "travis-ci@picocms.org"
  10. #copy new files to release number
  11. cp -a $TRAVIS_BUILD_DIR/build/docs/pico-$TRAVIS_TAG $TRAVIS_BUILD_DIR/build/Pico/phpDoc/pico-$TRAVIS_TAG
  12. #move old files
  13. mv -f $TRAVIS_BUILD_DIR/build/Pico/phpDoc/master $TRAVIS_BUILD_DIR/build/Pico/phpDoc/old-stable
  14. #copy new files to master
  15. cp -a $TRAVIS_BUILD_DIR/build/docs/pico-$TRAVIS_TAG $TRAVIS_BUILD_DIR/build/Pico/phpDoc/master
  16. # Add the files to our commit
  17. git add $TRAVIS_BUILD_DIR/build/Pico/phpDoc/*
  18. # Commit the files with our commit message
  19. git commit -m "Update Documentation for Pico $TRAVIS_TAG"
  20. # Force push from the current repo's master branch to the remote
  21. # repo's gh-pages branch.We redirect any output to
  22. # /dev/null to hide any sensitive credential data that might otherwise be exposed.
  23. git push --force --quiet "https://${GITHUB_OAUTH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1