Skip to content

Commit 10ccc86

Browse files
committed
[FEAT] CI/CD 파일 수정
1 parent e453dfd commit 10ccc86

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
build-and-deploy:
11-
runs-on: ubuntu-latest
11+
runs-on: self-hosted
1212

1313
steps:
1414
- name: Checkout code
@@ -26,25 +26,11 @@ jobs:
2626
- name: Build with Gradle
2727
run: ./gradlew clean build -x test
2828

29-
- name: Create SSH key file
30-
run: |
31-
echo "${{ secrets.EC2_SSH_KEY }}" > private_key.pem
32-
chmod 600 private_key.pem
33-
3429
- name: Deploy to EC2
3530
run: |
36-
scp -i private_key.pem -o StrictHostKeyChecking=no \
37-
build/libs/*.jar ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:/home/ubuntu/app.jar
38-
39-
ssh -i private_key.pem -o StrictHostKeyChecking=no \
40-
${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF'
41-
sudo systemctl restart studylink
42-
sudo systemctl status studylink
43-
EOF
44-
45-
- name: Clean up
46-
if: always()
47-
run: rm -f private_key.pem
31+
sudo cp build/libs/*.jar /home/ubuntu/app.jar
32+
sudo systemctl restart studylink
33+
sudo systemctl status studylink
4834
4935
- name: Send deployment notification
5036
if: success()

0 commit comments

Comments
 (0)