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
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user