Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/ssh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: SSH Connection Test

on:
push:
branches:
- dev

jobs:
test-ssh:
runs-on: ubuntu-latest

steps:
- name: SSH into VM and run deployment
run: |
echo "${{ secrets.KEY }}" > key.pem
chmod 600 key.pem

ssh -tt -o ServerAliveInterval=60 -o ServerAliveCountMax=5 \
-i key.pem -o StrictHostKeyChecking=no -o IdentitiesOnly=yes \
[email protected] << 'EOF'

echo "✅ Logged into VM successfully"
whoami

echo "📂 Listing contents of home directory:"
ls ~

echo "========== Deployment Started: \$(date) =========="
echo "Processing TapgoUI-Kiosk..."

cd ~/TapgoUI-Kiosk || { echo "[ERROR] Directory TapgoUI-Kiosk not found"; exit 1; }

echo "[INFO] Listing files in TapgoUI-Kiosk directory..."
ls -la

echo "[INFO] Pulling latest changes from dev branch..."
sudo git pull origin dev || { echo "[ERROR] Git pull failed"; exit 1; }

echo "[INFO] Installing dependencies..."
sudo npm install --legacy-peer-deps || { echo "[ERROR] npm install failed"; exit 1; }

echo "[INFO] Building the Angular app..."
sudo npm run build || { echo "[ERROR] Build failed"; exit 1; }


echo "[✅ SUCCESS] Deployment completed at \$(date)"
echo "==============================================="

echo "[✅ FINISHED] Closing SSH connection."
exit 0
EOF