Skip to content

Commit d7fed55

Browse files
authored
created workflow to test the ssh
1 parent 04c91f9 commit d7fed55

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/test-ssh.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test SSH Connection
2+
3+
on:
4+
workflow_dispatch: # Manual trigger only
5+
6+
jobs:
7+
test-ssh:
8+
name: Test SSH Connection to Lightsail
9+
runs-on: ubuntu-latest
10+
environment: production
11+
12+
steps:
13+
- name: Test SSH Connection
14+
uses: appleboy/[email protected]
15+
with:
16+
host: ${{ vars.LIGHTSAIL_PUBLIC_IP }}
17+
username: ${{ vars.LIGHTSAIL_USERNAME }}
18+
key: ${{ secrets.LIGHTSAIL_SSH_KEY }}
19+
port: 22
20+
script: |
21+
echo "🚀 SSH Connection successful!"
22+
echo "Server info:"
23+
uname -a
24+
echo ""
25+
echo "Current user: $(whoami)"
26+
echo "Current directory: $(pwd)"
27+
echo "Home directory: $HOME"
28+
echo ""
29+
echo "Docker status:"
30+
docker --version || echo "Docker not installed"
31+
echo ""
32+
echo "Docker Compose status:"
33+
docker compose version || echo "Docker Compose not installed"
34+
echo ""
35+
echo "Available disk space:"
36+
df -h /
37+
echo ""
38+
echo "Available memory:"
39+
free -h
40+
echo ""
41+
echo "✅ SSH test completed successfully!"

0 commit comments

Comments
 (0)