Showcase update - f20be312
Quote Bot CI/CD Pipeline / check (push) Waiting to run
Quote Bot CI/CD Pipeline / Security Scan (push) Waiting to run
Quote Bot CI/CD Pipeline / Build and push to Docker Hub (push) Blocked by required conditions
Quote Bot CI/CD Pipeline / Deploy to VPS via Ansible (push) Blocked by required conditions

This commit is contained in:
GitLab CI/CD
2026-09-13 10:32:45 +00:00
commit 63c6a83e88
20 changed files with 673 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
# deploy.yml
- name: Автоматический деплой Telegram-бота
hosts: all
vars:
image_name: "leor156/quote-bot:{{ image_tag | default('latest') }}"
container_name: "quote-bot"
container_state: "started"
tasks:
- name: Убеждаемся, что установлена библиотека Docker для Python
apt:
name: python3-docker
state: present
update_cache: yes
- name: Скачиваем образ бота с Docker Hub
community.docker.docker_image:
name: "{{ image_name }}"
source: pull
- name: Запускаем контейнер
community.docker.docker_container:
name: "{{ container_name }}"
image: "{{ image_name }}"
state: "{{ container_state }}"
restart_policy: unless-stopped
pull: always
env:
TOKEN: "{{ lookup('env', 'BOT_TOKEN') }}"
ADMIN_IDS: "{{ lookup('env', 'ADMIN_ID_TG') }}"
- name: Чистка
community.docker.docker_prune:
images: yes
images_filters:
dangling: true