Skip to content

Commit

Permalink
Deploy test
Browse files Browse the repository at this point in the history
  • Loading branch information
basshamut committed Jun 24, 2024
1 parent 5af6242 commit 32184d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ jobs:
SSH_KEY: ${{ secrets.VPS_SSH_KEY }}
run: |
# Crear directorios en el VPS
sshpass -p "VPS_SSH_PASSWORD" ssh -o StrictHostKeyChecking=no VPS_SSH_USERNAME@VPS_SSH_HOST << 'EOF'
sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SSH_HOST << 'EOF'
mkdir -p /var/www/html/virtual-dojo/frontend
mkdir -p /var/www/html/virtual-dojo/backend
exit
EOF
# Copiar el build del frontend al VPS
sshpass -p "VPS_SSH_PASSWORD" scp -o StrictHostKeyChecking=no -r ./frontend/dist/* VPS_SSH_USERNAME@VPS_SSH_HOST:/var/www/html/virtual-dojo/frontend
sshpass -p "$SSH_PASSWORD" scp -o StrictHostKeyChecking=no -r ./frontend/dist/* $SSH_USERNAME@$SSH_HOST:/var/www/html/virtual-dojo/frontend
# Copiar el backend al VPS
sshpass -p "VPS_SSH_PASSWORD" scp -o StrictHostKeyChecking=no -r ./backend/* VPS_SSH_USERNAME@VPS_SSH_HOST:/var/www/html/virtual-dojo/backend
sshpass -p "$SSH_PASSWORD" scp -o StrictHostKeyChecking=no -r ./backend/* $SSH_USERNAME@$SSH_HOST:/var/www/html/virtual-dojo/backend
# Conectar al VPS y reiniciar el backend
sshpass -p "VPS_SSH_PASSWORD" ssh -o StrictHostKeyChecking=no VPS_SSH_USERNAME@VPS_SSH_HOST << 'EOF'
sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SSH_HOST << 'EOF'
cd /var/www/html/virtual-dojo/backend
npm install
pm2 restart all || pm2 start server.js --name virtual-dojo
Expand Down

0 comments on commit 32184d4

Please sign in to comment.