File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,16 @@ jobs:
2626 id : get_branch
2727 run : echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
2828
29- - name : Setup SSH Key (if needed)
29+ - name : Setup SSH Key
3030 run : |
3131 mkdir -p ~/.ssh
32+ echo "${{ secrets.NEUROJ_SERVER_SSH_KEY_PRIVATE }}" > ~/.ssh/id_rsa
33+ chmod 600 ~/.ssh/id_rsa
3234 ssh-keyscan -H ${{ secrets.NEUROJ_SERVER }} >> ~/.ssh/known_hosts
3335
36+ - name : Test SSH Connection
37+ run : ssh -v njweb@${{ secrets.NEUROJ_SERVER }} "echo 'SSH Connection Successful'"
38+
3439 - name : Deploy to Server via SCP
3540 run : |
3641 echo "Deploying to /var/www/html/dev/${{ env.BRANCH_NAME }}/"
4247 ssh njweb@${{ secrets.NEUROJ_SERVER }} << EOF
4348 cd /var/www/html/dev/${{ env.BRANCH_NAME }}/ && pm2 restart all || echo "No PM2 processes found in this directory"
4449 EOF
50+
51+ - name : Cleanup SSH Key
52+ run : rm -f ~/.ssh/id_rsa
You can’t perform that action at this time.
0 commit comments