esameits24-26frontend/.github/workflows/deploy.yml
AV77web fafedd26a7
All checks were successful
Deploy to VPS / build (push) Successful in 29s
Deploy to VPS / deploy (push) Successful in 10s
inserito il timeout in /github/workflow/deploy.yml
2026-07-14 14:11:54 +02:00

42 lines
No EOL
1.2 KiB
YAML

name: Deploy to VPS
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout@v4
- uses: https://github.com/actions/setup-node@v4
with:
node-version: "20"
- run: npm ci --prefer-offline
- run: npm run build
env:
VITE_API_URL: https://esameits24-26backend.andreavillari.it
deploy:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: https://github.com/actions/checkout@v4
- uses: https://github.com/appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
commnand_timeout: 30m
script: |
echo "=== START $(date -Iseconds) ==="
cd /root/esameits24-26frontend # o backend
git pull --ff-only
echo "=== DOCKER BUILD $(date -Iseconds) ==="
docker compose --progress plain up -d --build
echo "=== END $(date -Iseconds) ==="
docker compose ps
echo "DEPLOY COMPLETE"