-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy.yml
38 lines (32 loc) · 875 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
- name: Deploy LandingPage
hosts: web
become: yes
vars:
project_dir: "/root/app/gmonad.cc"
git_repo: "https://github.com/monad-cn/gmonad.cc"
git_branch: "main"
tasks:
- name: Ensure the project directory exists
file:
path: "{{ project_dir }}"
state: directory
- name: Clone the repository
git:
repo: "{{ git_repo }}"
dest: "{{ project_dir }}"
version: "{{ git_branch }}"
force: yes
register: git_clone
- name: Install dependencies
npm:
path: "{{ project_dir }}"
state: present
when: git_clone.changed
- name: Build the project
command: "npm run docs:build"
args:
chdir: "{{ project_dir }}"
- name: Copy for nginx
command: "cp -r .vitepress/dist /var/www/"
args:
chdir: "{{ project_dir }}"