deploy-ci.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #! /bin/sh
  2. mkdir temp_web
  3. git config user.name "element_bot"
  4. git config user.email "element_bot"
  5. # build dev site
  6. if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
  7. CI_ENV=/dev/ ./node_modules/.bin/cooking build -c build/cooking.demo.js
  8. cd temp_web
  9. git clone https://$GH_TOKEN@github.com/ElementUI/dev.git && cd dev
  10. rm -rf *
  11. cp -rf ../../examples/element-ui/** .
  12. git add -A .
  13. git commit -m "$TRAVIS_COMMIT_MSG"
  14. git push origin master
  15. cd ../..
  16. fi
  17. # build lib
  18. if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
  19. npm run dist
  20. cd temp_web
  21. git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib
  22. rm -rf *
  23. cp -rf ../../lib/** .
  24. git add -A .
  25. git commit -m "[build] $TRAVIS_TAG"
  26. git tag $TRAVIS_TAG
  27. git push origin master --tags
  28. cd ../..
  29. fi
  30. # build site
  31. if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
  32. npm run deploy
  33. cd temp_web
  34. git clone https://$GH_TOKEN@github.com/ElemeFE/element.git && cd element
  35. git checkout gh-pages
  36. rm -rf *
  37. cp -rf ../../examples/element-ui/** .
  38. git add -A .
  39. git commit -m "$TRAVIS_COMMIT_MSG"
  40. git push origin gh-pages
  41. cd ../..
  42. fi