-
Notifications
You must be signed in to change notification settings - Fork 63
59 lines (51 loc) · 1.68 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
name: Reminders Deployment Pipeline
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [dev]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use cached node_modules
uses: c-hive/gha-yarn-cache@v2
with:
directory: frontend
- name: install Dependencies
run: |
CI="" yarn run holoInstall
CI="" yarn build
- name: Exec remote commands via SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOSTNAME }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd /var/www/zc_plugin_reminder/
git stash
git fetch --all
git reset --hard origin/dev
git checkout dev
git pull origin dev
yarn run holoInstall
- name: copy build to server
uses: Creepios/[email protected]
with:
username: ${{ secrets.USERNAME }}
host: ${{ secrets.HOSTNAME }}
password: ${{ secrets.PASSWORD }}
localPath: './frontend/build/'
remotePath: '/var/www/zc_plugin_reminder/frontend/build'
- name: restart pm2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOSTNAME }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script:
PORT=3008 pm2 start yarn --name "reminders_plugin" --max-memory-restart 670M -- start
pm2 list