-
Notifications
You must be signed in to change notification settings - Fork 101
71 lines (62 loc) · 1.95 KB
/
spa_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
name: Zuri DM Deployment File
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
#pull_request:
# 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: install Dependencies && run build statics
run: |
cd dmreactplugin
git init
yarn install
yarn build
cd dist
pwd
- name: Git Pull on Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ZURI_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/zc_plugin_dm
git fetch --all
git reset --hard origin/main
git stash
git pull
cd dmreactplugin
git init
yarn install
cd ../dmspa/
git init
yarn install
yarn build
- name: copy build to server
uses: Creepios/sftp-action@v1.0.1
with:
host: ${{ secrets.ZURI_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
localPath: './dmreactplugin/dist/'
remotePath: '/home/orpheus/zc_plugin_dm/dmreactplugin/dist'
- name: serve app
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ZURI_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/zc_plugin_dm
source env/bin/activate
pip install -r requirements.txt --upgrade
python3 manage.py collectstatic --noinput
fuser -k 9090/tcp
gunicorn --bind 0.0.0.0:9090 zc_plugin_dm.wsgi --daemon