Files
Frontend/infra/ansible/playbook.yml
T
d3m0k1d 2a108e1b5a
CI / build (push) Failing after 2m11s
Deploy / deploy (push) Has been cancelled
feat: ci for all pushes, deploy with ssh key, local compose with build
2026-06-13 21:00:09 +03:00

33 lines
806 B
YAML

---
- name: Deploy Frontend
hosts: prod
vars:
deploy_path: /opt/app
tasks:
- name: Ensure deployment directory
ansible.builtin.file:
path: "{{ deploy_path }}"
state: directory
- name: Copy docker-compose
ansible.builtin.copy:
src: "{{ playbook_dir }}/../docker-compose.yml"
dest: "{{ deploy_path }}/docker-compose.yml"
- name: Pull images
ansible.builtin.shell:
cmd: docker compose pull
chdir: "{{ deploy_path }}"
environment:
REGISTRY: "{{ registry }}"
TAG: "{{ tag }}"
- name: Start services
ansible.builtin.shell:
cmd: docker compose up -d --remove-orphans
chdir: "{{ deploy_path }}"
environment:
REGISTRY: "{{ registry }}"
TAG: "{{ tag }}"