From 8eabdca9bfcbba2bf4f01607f227c824d18bc365 Mon Sep 17 00:00:00 2001 From: AV77web Date: Thu, 28 May 2026 18:50:04 +0200 Subject: [PATCH] modifica finale a deploy.yml --- .github/workflows/deploy.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b16aab0..c992caf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,11 +4,13 @@ on: push: branches: - main + workflow_dispatch: jobs: build: runs-on: ubuntu-latest + steps: - name: Checkout uses: https://github.com/actions/checkout@v4 @@ -17,27 +19,16 @@ jobs: uses: https://github.com/actions/setup-node@v4 with: node-version: "20" - cache: npm - cache-dependency-path: package-lock.json - - - name: Restore Next.js cache - uses: https://github.com/actions/cache@v4 - with: - path: | - .next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.[jt]s', '**/*.[jt]sx') }} - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - - name: Install dependencies - run: npm ci + run: npm ci --prefer-offline - name: Build run: npm run build deploy: needs: build + runs-on: ubuntu-latest steps: @@ -46,12 +37,17 @@ jobs: - name: Deploy via SSH uses: https://github.com/appleboy/ssh-action@v1.0.3 + with: - host: ${{ secrets.VPS_HOST }} + host: ${{ secrets.VPS_HOSTNAME }} username: ${{ secrets.VPS_USER }} key: ${{ secrets.VPS_SSH_KEY }} + script: | echo "START DEPLOY" + cd /root/magricambi + git pull --ff-only + docker compose up -d --build