-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.2 KB
/
awsDeploy.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
name: EC2 Deploy
on:
push:
branches: [ main ]
jobs:
build:
name: EC2 Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@v2
- name: Stop PM2
uses: alinz/ssh-scp-action@master
with:
port: 22
key: ${{ secrets.EC2_KEY }}
host: ${{ secrets.EC2_HOST_IPAAS }}
user: ${{ secrets.EC2_USER }}
ssh_before: |
pm2 kill
- name: Copy Files
uses: burnett01/[email protected]
with:
switches: -avzr --delete
remote_path: /var/www/ipaasincendin/
remote_key: ${{ secrets.EC2_KEY }}
remote_host: ${{ secrets.EC2_HOST_IPAAS }}
remote_user: ${{ secrets.EC2_USER }}
- name: Start PM2
uses: alinz/ssh-scp-action@master
with:
port: 22
key: ${{ secrets.EC2_KEY }}
host: ${{ secrets.EC2_HOST_IPAAS }}
user: ${{ secrets.EC2_USER }}
ssh_before: |
cd /var/www/ipaasincendin
sudo npm install
cd /var/www/ipaasincendin/src
pm2 start index.js --name prod -- prod
pm2 start index.js --name local -- local