portal/deploy/deploy.yml
2025-03-24 11:17:30 -04:00

26 lines
757 B
YAML

- name: Deploy the app
hosts: all
remote_user: deploy
tasks:
- name: Copy app files to server
synchronize:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop: "{{ deploy_files }}"
- name: Install npm deps
shell:
cmd: "source /home/deploy/.nvm/nvm.sh && nvm exec default npm install"
chdir: /home/{{ domain }}
args:
executable: /bin/bash
- name: Run migrations
shell:
cmd: "source /home/deploy/.nvm/nvm.sh && nvm exec default npx prisma migrate deploy && nvm exec default npx prisma generate"
chdir: /home/{{ domain }}
args:
executable: /bin/bash
- name: Start the app with systemd
shell: "sudo systemctl restart {{ domain }}"