deploy-phpdoc.sh 1.3 KB

1234567891011121314151617181920212223242526272829
  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/$TRAVIS_TAG $TRAVIS_BUILD_DIR/build/Pico/phpDoc/$TRAVIS_TAG
  12. #move old master files to old-stable
  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/$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 gh-pages branch to the remote repo's gh-pages branch.
  21. # We redirect output to /dev/null to hide any sensitive data that might otherwise be exposed.
  22. git push --force --quiet "https://${GITHUB_OAUTH_TOKEN}@github.com/picocms/Pico.git" master:gh-pages > /dev/null 2>&1