Skip to content

Commit 2287a2c

Browse files
authored
Merge pull request #4 from 2025-Graduation-Design/new
feat : gradel.yml 추가
2 parents 072a985 + 762eeae commit 2287a2c

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Deploy to EC2 on develop push
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Add SSH Key
13+
uses: webfactory/ssh-agent@v0.5.4
14+
with:
15+
ssh-private-key: ${{ secrets.SSH_KEY }}
16+
17+
- name: Add EC2 Host to known_hosts
18+
run: ssh-keyscan -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
19+
20+
- name: Run deploy.sh on EC2
21+
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "bash /home/ubuntu/deploy.sh"

0 commit comments

Comments
 (0)