From 36486094667389c502452f725e5178a12d98bf78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=8A=B9=EA=B7=9C?= <156777781+wwingyou@users.noreply.github.com> Date: Mon, 25 Mar 2024 01:43:29 +0900 Subject: [PATCH] Update auto-deployment.yml --- .github/workflows/auto-deployment.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-deployment.yml b/.github/workflows/auto-deployment.yml index d3ea607..b623c3d 100644 --- a/.github/workflows/auto-deployment.yml +++ b/.github/workflows/auto-deployment.yml @@ -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