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