corrieribackend/.github/workflows/deploy.yml
AV77web 0d82ae4bdf
Some checks failed
Deploy to VPS / build (push) Successful in 14s
Deploy to VPS / deploy (push) Failing after 4s
correzione a .github/workflows/deploy.yml VPS_USER,VPS_HOST e VPS_SSH_KEY
2026-06-21 00:16:09 +02:00

46 lines
No EOL
997 B
YAML

name: Deploy to VPS
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Setup Node.js
uses: https://github.com/actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm ci --prefer-offline
- name: Build
run: npm run build
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Deploy via SSH
uses: https://github.com/appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
script: |
echo "START DEPLOY"
cd /opt/apps/corrieribackend
git pull --ff-only
docker compose up -d --build