ci: deploy via SSH to host with git checkout and Docker build
This commit is contained in:
@@ -37,12 +37,20 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
chmod 600 ~/.ssh/config
|
chmod 600 ~/.ssh/config
|
||||||
|
|
||||||
- name: Pull and redeploy
|
- name: Build and redeploy
|
||||||
run: |
|
run: |
|
||||||
sshpass -e ssh vps <<'ENDSSH'
|
sshpass -e ssh vps <<'ENDSSH'
|
||||||
set -e
|
set -e
|
||||||
cd /path/to/kotobane
|
REPO=/home/achmad/services/kotobane
|
||||||
docker compose pull 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 compose up -d --no-deps kotobane
|
||||||
docker image prune -f
|
docker image prune -f
|
||||||
ENDSSH
|
ENDSSH
|
||||||
|
|||||||
Reference in New Issue
Block a user