-
Notifications
You must be signed in to change notification settings - Fork 66
73 lines (63 loc) · 1.84 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Zuri goals Deployment
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use cached node_modules
uses: c-hive/gha-yarn-cache@v2
with:
directory: client
- name: install Dependencies && run build statics
run: |
ls
yarn install
cd client
yarn install
yarn build
- name: Run tests
run: |
yarn run coverage
- name: Git Pull on Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ZURI_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd /var/www/zc_plugin_company_goals/
git stash
git fetch --all
git reset --hard origin/main
git pull
cd client/
yarn install
cd ../serve-client
yarn install
yarn build
cd ..
yarn install
- name: copy build to server
uses: Creepios/[email protected]
with:
username: ${{ secrets.USERNAME }}
host: ${{ secrets.ZURI_HOST }}
password: ${{ secrets.PASSWORD }}
localPath: './client/dist/'
remotePath: '/var/www/zc_plugin_company_goals/client/dist'
- name: restart pm2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ZURI_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
pm2 list
pm2 restart 0
pm2 reload 0