From 3b89b363b3efa13ba33ac355585a2f5f50bcb856 Mon Sep 17 00:00:00 2001 From: achmad Date: Thu, 28 May 2026 23:58:15 +0700 Subject: [PATCH] ci: deploy via SSH to host with git checkout and Docker build --- .gitea/workflows/deploy.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 702a5bc..f3c6a68 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -37,12 +37,20 @@ jobs: EOF chmod 600 ~/.ssh/config - - name: Pull and redeploy + - name: Build and redeploy run: | sshpass -e ssh vps <<'ENDSSH' set -e - cd /path/to/kotobane - docker compose pull kotobane + REPO=/home/achmad/services/kotobane + + cd "$REPO" + git fetch origin --prune + git reset --hard + git clean -fd + git checkout main + git reset --hard origin/main + + docker compose build kotobane docker compose up -d --no-deps kotobane docker image prune -f ENDSSH