0.0066
Some checks failed
Build Docker / deploy (push) Failing after 38s
Build Docker / build (push) Has been skipped

This commit is contained in:
2026-03-01 17:03:42 +03:00
parent 0b00adb290
commit 6b01b63b59
2 changed files with 11 additions and 13 deletions

View File

@@ -12,8 +12,8 @@ jobs:
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/id_fin
chmod 600 /tmp/id_fin
# - name: Install Ansible collection
# run: ansible-galaxy collection install community.docker
- name: Install Ansible collection
run: ansible-galaxy collection install community.docker
- name: Create inventory
run: echo "${{ secrets.INVENTORY }}" > inventory.ini
- name: Create secrets.yml
@@ -29,7 +29,7 @@ jobs:
sparse-checkout: |
ansible/deploy.yml
- name: Run Ansible playbook
run: ansible-playbook -i inventory.ini tmp-repo/ansible/deploy.yml -e @secrets.yml
run: ansible-playbook -i inventory.ini tmp-repo/ansible/deploy.yml -e @secrets.yml -e env_file="$(pwd)/.env"
env:
ANSIBLE_PRIVATE_KEY_FILE: /tmp/id_fin
ANSIBLE_HOST_KEY_CHECKING: "False"

View File

@@ -1,7 +1,7 @@
- hosts: servers
become: yes
vars:
env_file: .env
env_file: $(pwd)/.env
tasks:
- name: Install Docker
shell: curl -fsSL https://get.docker.com | sh
@@ -26,12 +26,10 @@
repo: "{{ gitea_instance_url }}"
dest: /opt/infra
# - name: Start docker compose via module
# community.docker.docker_compose_v2:
# project_src: /opt/infra
# files:
# - node-docker.yaml
# state: present
# restarted: true
- name: Start docker compose
shell: docker-compose -f /opt/infra/node-docker.yaml up -d
- name: Start docker compose via module
community.docker.docker_compose_v2:
project_src: /opt/infra
files:
- node-docker.yaml
state: present
restarted: true