update readme #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to VM | |
| on: | |
| push: | |
| branches: | |
| - main # Only triggers on pushes to main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install sshpass | |
| run: sudo apt-get install -y sshpass | |
| - name: Add host to known_hosts | |
| run: | | |
| mkdir -p ~/.ssh | |
| chmod 700 ~/.ssh | |
| ssh-keyscan -H ${{ secrets.VM_HOST }} >> ~/.ssh/known_hosts | |
| chmod 600 ~/.ssh/known_hosts | |
| - name: Update code and deploy | |
| env: | |
| SSHPASS: ${{ secrets.SSH_PASSWORD }} | |
| run: | | |
| sshpass -e ssh -o StrictHostKeyChecking=no ${{ secrets.VM_USERNAME }}@${{ secrets.VM_HOST }} ' | |
| cd /root/crypto/quant-hub && | |
| git pull && | |
| sudo sh deploy.sh | |
| ' |