Skip to content

Commit

Permalink
Update run-ansible-configs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Saumya40-codes authored Aug 4, 2024
1 parent 2e91318 commit b1b5e15
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/run-ansible-configs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: Run Ansible Configurations

on:
push:
branches:
- master
paths:
- 'server/**'
- '.github/workflows/run-ansible-configs.yml'

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -35,15 +38,11 @@ jobs:
- name: Add SSH key
run: |
set -x
mkdir -p ~/.ssh
echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_ed25519_temp
chmod 600 ~/.ssh/id_ed25519_temp
ssh-keygen -p -f ~/.ssh/id_ed25519_temp -m pem -N ""
mv ~/.ssh/id_ed25519_temp ~/.ssh/id_ed25519
echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ls -l ~/.ssh/id_ed25519
ssh-keyscan -H ${{ secrets.EC2_PRIVATE_IP_1 }} >> ~/.ssh/known_hosts
ls -l ~/.ssh/id_ed25519
cat ~/.ssh/known_hosts
shell: bash

Expand Down

0 comments on commit b1b5e15

Please sign in to comment.