ci: deploy via SSH to host with git checkout and Docker build

This commit is contained in:
achmad
2026-05-28 23:58:15 +07:00
parent ae4472ef16
commit 3b89b363b3
+11 -3
View File
@@ -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