-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (29 loc) · 806 Bytes
/
deploy.yml
File metadata and controls
33 lines (29 loc) · 806 Bytes
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
name: Deploy to EC2
on:
push:
branches:
- main
paths:
- "backend/**"
concurrency:
group: deploy-production
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: 52.66.7.244
username: ubuntu
key: ${{ secrets.DEPLOY_KEY }}
command_timeout: 5m
script: |
set -e
cd ~/softwareProject
git pull origin main
cd backend
npm install --omit=dev
pm2 restart backend
pm2 save