Skip to content

Commit

Permalink
Fix: ssh key pem debug 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
minchodang committed May 17, 2024
1 parent 629898b commit 09451e7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ jobs:
run: |
echo "$SSH_KEY" > key.pem
chmod 600 key.pem
echo "SSH key file created and permissions set."
ls -la key.pem # 키 파일이 제대로 생성되었는지 확인
cat key.pem # 키 파일 내용 확인 (보안 상 민감하므로 실제로는 출력하지 않음)
# Debugging: Verify the key file is correctly created and permissions are set
echo "SSH key file content:"
cat key.pem
echo "SSH key file permissions:"
ls -l key.pem
- name: Connect and run script on remote host
run: |
ssh -i key.pem -o StrictHostKeyChecking=no ${USER}@${HOST} "bash git-action.sh"
ssh -v -i key.pem -o StrictHostKeyChecking=no ${USER}@${HOST} "bash git-action.sh"
env:
USER: ${{ secrets.USER }}
HOST: ${{ secrets.HOST }}
SSH_KEY: ${{ secrets.SSH_KEY }}
# 추가된 환경 변수들
AWS_DEFAULT_REGION: ap-northeast-2
AWS_REGION: ap-northeast-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -48,9 +49,6 @@ jobs:
GOOGLE_CALLBACK_URL: ${{ secrets.GOOGLE_CALLBACK_URL }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}




- name: Remove Github Actions IP From Security Group
run: |
aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
Expand Down

0 comments on commit 09451e7

Please sign in to comment.