File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,19 +91,14 @@ jobs:
9191 echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key
9292 chmod 600 ~/.ssh/deploy_key
9393
94- # Create askpass script so ssh can provide the passphrase non-interactively
95- cat > ~/.ssh/askpass.sh << 'ASKPASS'
96- #!/bin/sh
97- echo "$SSH_PASS"
98- ASKPASS
99- chmod +x ~/.ssh/askpass.sh
94+ # Strip passphrase so ssh doesn't need askpass
95+ cp ~/.ssh/deploy_key ~/.ssh/deploy_key.locked
96+ ssh-keygen -p -f ~/.ssh/deploy_key.locked -P "$SSH_PASS" -N "" -q
97+ mv ~/.ssh/deploy_key.locked ~/.ssh/deploy_key
10098
10199 - name : Deploy via SSH
102- env :
103- SSH_ASKPASS : ~/.ssh/askpass.sh
104- SSH_ASKPASS_REQUIRE : force
105100 run : |
106- ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << 'DEPLOY'
101+ ssh -T - o StrictHostKeyChecking=no -i ~/.ssh/deploy_key -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << 'DEPLOY'
107102 cd ${{ secrets.DEPLOY_PATH }}
108103
109104 # Pull latest images
You can’t perform that action at this time.
0 commit comments