feat: full CI/CD pipeline — build, push to registry, deploy to prod
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Failing after 16s

This commit is contained in:
vrubel 2026-06-06 21:44:45 +00:00
parent a606f9d18c
commit f876cba39a
3 changed files with 23 additions and 9 deletions

View file

@ -6,7 +6,7 @@ on:
- master
jobs:
build:
build-and-deploy:
runs-on: shell
steps:
- name: Clone repository
@ -23,7 +23,7 @@ jobs:
- name: Build Docker image
run: docker compose build
- name: Start container
- name: Start container for test
run: docker compose up -d
- name: Verify bot running
@ -34,10 +34,14 @@ jobs:
- name: Stop container
run: docker compose down
deploy:
needs: build
runs-on: ubuntu-latest
environment: production
steps:
- name: Deploy (placeholder)
run: echo "🚀 Деплой будет добавлен позже"
- name: Login to Gitea Container Registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login 192.168.8.174:3000 -u "${{ secrets.REGISTRY_USER }}" --password-stdin
- name: Push image to registry
run: docker push 192.168.8.174:3000/vrubel/t2s-telegram-bot:latest
- name: Copy docker-compose to prod host
run: scp docker-compose.prod.yml 192.168.8.171:~/services/t2sTelegramBot/docker-compose.yml
- name: Deploy on prod host
run: ssh 192.168.8.171 "cd ~/services/t2sTelegramBot && docker compose pull && docker compose up -d --remove-orphans"