Skip to content

Commit 9a87786

Browse files
authored
Merge pull request #77 from yyoonngg/refactor/change-server
fix: deploy yml
2 parents f6227a3 + d8e6500 commit 9a87786

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

.github/workflows/cd_java.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,12 @@ jobs:
3535
mv "$JAR" build/libs/hidaddy.jar
3636
ls -al build/libs
3737
38-
# ----- root 계정 사용, 키는 Secrets의 PEM(개행 포함) -----
39-
- name: Write SSH key to file
40-
run: |
41-
echo "${{ secrets.EC2_KEY }}" > /tmp/deploy.pem
42-
chmod 600 /tmp/deploy.pem
43-
4438
- name: Upload JAR and Service File to server (root)
4539
uses: appleboy/scp-action@v0.1.6
4640
with:
4741
host: ${{ secrets.EC2_HOST }}
48-
username: root
49-
key_path: /tmp/deploy.pem
42+
username: ${{ secrets.USER }}
43+
key: ${{ secrets.EC2_KEY }}
5044
source: "build/libs/hidaddy.jar,deploy/hidaddy.service"
5145
target: "/root"
5246
strip_components: 0
@@ -55,8 +49,8 @@ jobs:
5549
uses: appleboy/ssh-action@v1.0.3
5650
with:
5751
host: ${{ secrets.EC2_HOST }}
58-
username: root
59-
key_path: /tmp/deploy.pem
52+
username: ${{ secrets.USER }}
53+
key: ${{ secrets.EC2_KEY }}
6054
script: |
6155
# SSH 연결 테스트
6256
echo "SSH connection successful"

0 commit comments

Comments
 (0)