Skip to content

Commit 04aa139

Browse files
testing ci/cd
1 parent 1debdff commit 04aa139

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Deploy to EC2
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Deploy via SSH
14+
uses: appleboy/ssh-action@v1.0.3
15+
with:
16+
host: 43.205.143.123
17+
username: ubuntu
18+
key: ${{ secrets.EC2_SSH_KEY }}
19+
script: |
20+
cd /var/www/softwareProject
21+
git pull origin main
22+
cd backend
23+
npm install --omit=dev
24+
pm2 restart backend

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ coverage/
4848
# Environment variables (CONTAINS SENSITIVE DATA - MONGODB URI, JWT SECRET, AWS KEYS)
4949
.env
5050
.env.*.local
51+
52+
# SSH keys - NEVER commit these
53+
*.pem
54+
*.key
5155
.env.local
5256
.env.test
5357

frontend/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ dist-ssr
2424
*.sw?
2525

2626

27-
COST_REDUCTION_TIPS.md
27+
COST_REDUCTION_TIPS.md
28+
*.pem

0 commit comments

Comments
 (0)