Skip to content

Commit bcb70e8

Browse files
committed
Solve Issue with action
1 parent 06e5ecd commit bcb70e8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/build-deploy-zodiac.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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 }}/"
@@ -42,3 +47,6 @@ jobs:
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

0 commit comments

Comments
 (0)