Skip to content

Commit 5005e10

Browse files
authored
Update workflow to deploy to EC2
1 parent b9164be commit 5005e10

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Deploy to EC2
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Deploy to EC2
13+
uses: appleboy/ssh-action@master
14+
with:
15+
host: ${{ secrets.EC2_HOST }}
16+
username: ${{ secrets.EC2_USERNAME }}
17+
key: ${{ secrets.EC2_SSH_KEY }}
18+
script: |
19+
cd ~/TS-Backend-Production-Setup
20+
git pull origin main
21+
npm install
22+
npm run dist
23+
pm2 restart backend

0 commit comments

Comments
 (0)