Files
eggs-backend/.gitlab-ci.yml
husanjon ab73d05ecc
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
gold eggs backend
2026-04-15 08:59:36 +02:00

23 lines
666 B
YAML

stages:
- deploy
deploy_django_app:
stage: deploy
image: ubuntu:latest # Ubuntu tasvirini ishlatish
only:
- main
before_script:
- apt-get update && apt-get install -y openssh-client # Ubuntu/Debian uchun to'g'ri paket o'rnatish buyruqlari
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
script:
- ssh $SSH_USER@$SSH_HOST -p $SSH_PORT "
cd $DEPLOY_PATH &&
git pull origin main &&
docker compose up --build -d &&
docker image prune -f &&
echo 'Deploy jarayoni muvaffaqiyatli yakunlandi!'"