ci: deploy via SSH to host with git checkout and Docker build
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user