gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
22
.gitlab-ci.yml
Normal file
22
.gitlab-ci.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
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!'"
|
||||
|
||||
Reference in New Issue
Block a user