Skip to content

Commit

Permalink
Update auto-deployment.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wwingyou authored Mar 24, 2024
1 parent 37bc33c commit 3648609
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/auto-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ jobs:
./gradlew bootJar
./gradlew jarDir
- name: Connect to EC2
env:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
private_key: ${{ secrets.EC2_PRIVATE_KEY }}
run: |
EC2_HOST={{ secrets.EC2_HOST }}
EC2_USERNAME={{ secrets.EC2_USERNAME }}
echo {{ secrets.EC2_PRIVATE_KEY }} > private_key.pem
ssh -i private_key.pem "${EC2_USERNAME}@${EC2_HOST}" echo hello
echo $private_key > private_key.pem
ssh -i private_key.pem "${username}@${host}" echo hello

0 comments on commit 3648609

Please sign in to comment.