deploy.sh 702 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. # Decrypt the private key
  3. openssl aes-256-cbc -K $encrypted_a808e857cd51_key -iv $encrypted_a808e857cd51_iv -in .travis/ssh_key.enc -out ~/.ssh/id_rsa -d
  4. # Set the permission of the key
  5. chmod 600 ~/.ssh/id_rsa
  6. # Start SSH agent
  7. eval $(ssh-agent)
  8. # Add the private key to the system
  9. ssh-add ~/.ssh/id_rsa
  10. # Copy SSH config
  11. cp .travis/ssh_config ~/.ssh/config
  12. # Set Git config
  13. git config --global user.name "Tommy Chen"
  14. git config --global user.email tommy351@gmail.com
  15. # Clone the repository
  16. git clone git@github.com:tommy351/warehouse.git --branch gh-pages docs
  17. # Generate JSDoc
  18. npm run jsdoc
  19. # Push to GitHub
  20. cd docs
  21. git add -A
  22. git commit -m "Update docs"
  23. git push origin gh-pages --force