From 3ad8d89e5ccb89f2601dddb6cf5bc5190228f512 Mon Sep 17 00:00:00 2001 From: Andre Villari Date: Mon, 19 Oct 2026 16:08:38 +0200 Subject: [PATCH] creato file docker-compose e file deploy.yml --- .github/workflow/deploy.yml | 28 ++++++++++++++++++++++++++++ .gitingore | 2 ++ docke-compose.yml | 14 ++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 .github/workflow/deploy.yml create mode 100644 docke-compose.yml diff --git a/.github/workflow/deploy.yml b/.github/workflow/deploy.yml new file mode 100644 index 0000000..14891af --- /dev/null +++ b/.github/workflow/deploy.yml @@ -0,0 +1,28 @@ +name: Deploy to VPS + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + deploy: + 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: | + set -e + echo "START DEPLOY" + cd /root/andreavillari + git pull --ff-only + docker compose up -d --build \ No newline at end of file diff --git a/.gitingore b/.gitingore index e69de29..c74ff1b 100644 --- a/.gitingore +++ b/.gitingore @@ -0,0 +1,2 @@ +.env +/node_modules diff --git a/docke-compose.yml b/docke-compose.yml new file mode 100644 index 0000000..2186228 --- /dev/null +++ b/docke-compose.yml @@ -0,0 +1,14 @@ +version: '3.8' + +services: + react-app: + build: . + container_name: andreavillari + restart: always + env_file: + - .env + + ports: + - "80:80" + +