Skip to content

Commit f9094c4

Browse files
committed
Updated CI-CD.yml
1 parent 60a92b8 commit f9094c4

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

.github/workflows/CI-CD.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI/CD for Spring Boot App
33
on:
44
push:
55
branches:
6-
- main
6+
- master
77

88
jobs:
99
build:
@@ -43,22 +43,4 @@ jobs:
4343
id: setup-key
4444
env:
4545
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
46-
run: |
47-
echo "$DEPLOY_KEY" > $HOME/key.pem
48-
chmod 400 $HOME/key.pem
49-
cat $HOME/key.pem # Debugging step to verify key content
50-
51-
- name: Copy WAR to EC2
52-
uses: appleboy/scp-action@master
53-
with:
54-
host: ${{ secrets.DEPLOY_HOST }}
55-
username: ec2-user
56-
key: ${{ secrets.DEPLOY_KEY }}
57-
source: "target/*.war"
58-
target: "/home/ec2-user/deployment/"
59-
60-
- name: Connect SSH and Restart Services
61-
run: |
62-
ssh -o StrictHostKeyChecking=no -i $HOME/key.pem ec2-user@${{ secrets.DEPLOY_HOST }} '
63-
sudo systemctl restart spring-boot-app
64-
'
46+
run: |

0 commit comments

Comments
 (0)