Skip to content

Commit

Permalink
updated yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
saketh-05 committed Dec 15, 2024
1 parent fb12c79 commit bdc64fe
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,26 @@ jobs:
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa
# Save the private key
echo "${{ secrets.EC2_SSH_KEY }}" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H "${{ secrets.EC2_HOST }}" >> ~/.ssh/known_hosts
# Add EC2 host to known_hosts
ssh-keyscan -H "${{ secrets.EC2_HOST }}" >> ~/.ssh/known_hosts || {
echo "Failed to add host to known_hosts"; exit 1;
}
echo "SSH setup completed successfully"
# - name: Debug SSH
# run: |
# echo "EC2 Host: ${{ secrets.EC2_HOST }}"
# echo "Checking ~/.ssh directory:"
# ls -la ~/.ssh
# echo "Testing SSH connection:"
# ssh -i ~/.ssh/id_rsa ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} exit


# Step 6: Install Docker on EC2
- name: Install Docker on EC2
Expand Down

0 comments on commit bdc64fe

Please sign in to comment.