Skip to content

Commit 22b0b95

Browse files
committed
use synchronize instead of copy
1 parent 5026682 commit 22b0b95

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
ansible_host: staging.pycon.tw
2727
ansible_user: changchaishi
2828
ansible_ssh_private_key_file: private.pem
29-
ansible_python_interpreter: /usr/bin/python3
29+
ansible_python_interpreter: /home/dev/.pyenv/shims/python

deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
state: directory
2121

2222
- name: Copy entire project files to remote server
23-
ansible.builtin.copy:
24-
src: .
23+
ansible.posix.synchronize:
24+
src: ./
2525
dest: "{{ project_dir }}"
26+
delete: true
2627

2728
- name: Ensure docker network network-2023 exists
2829
community.docker.docker_network:
2930
name: network-2023
3031

3132
- name: Build and start service
3233
community.docker.docker_compose:
33-
project_src: web-projects/pycontw-2023-ansible
34+
project_src: "{{ project_dir }}"
3435
build: true
3536
# try to build first, without up the service
3637
state: present
37-

0 commit comments

Comments
 (0)