Skip to content

Commit 02bb207

Browse files
committed
[CICD] SSH 키 등록 오류 확인을 위한 디버깅 스크립트 추가
1 parent 0cb7206 commit 02bb207

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,22 @@ jobs:
8888
docker tag ${{ env.DOCKER_IMAGE_NAME }} $REPOSITORY_URI:${{ github.sha }}
8989
docker push $REPOSITORY_URI:${{ github.sha }}
9090
91+
- name: Debug SSH key setup
92+
run: |
93+
mkdir -p ~/.ssh
94+
echo "${{ secrets.EC2_PRIVATE_KEY }}" > ~/.ssh/id_rsa
95+
chmod 600 ~/.ssh/id_rsa
96+
ls -l ~/.ssh # 파일 존재 여부 및 권한 확인
97+
ssh-keyscan -H ${{ secrets.EC2_PUBLIC_IP }} >> ~/.ssh/known_hosts
98+
9199
# SSH 키 추가
92100
- name: Add SSH key
93101
run: |
94102
mkdir -p ~/.ssh
95103
echo "${{ secrets.EC2_PRIVATE_KEY }}" > ~/.ssh/id_rsa
96104
chmod 600 ~/.ssh/id_rsa
97105
ssh-keyscan -H ${{ secrets.EC2_PUBLIC_IP }} >> ~/.ssh/known_hosts
98-
106+
echo "SSH Key Added Successfully."
99107
100108
# EC2에서 컨테이너 실행
101109
- name: Deploy Docker container on EC2

0 commit comments

Comments
 (0)