From 94c6073089b52b740743ac3ba50f5ba18ca5b9eb Mon Sep 17 00:00:00 2001 From: moonjin-kim <69244467+moonjin-kim@users.noreply.github.com> Date: Wed, 13 Mar 2024 23:56:51 +0900 Subject: [PATCH] Update gradle.yml --- .github/workflows/gradle.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e6eead6..805d706 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -37,10 +37,7 @@ jobs: docker build -t ${{ secrets.DOCKER_REPO }}/planit-server . docker push ${{ secrets.DOCKER_REPO }}/planit-server - - name: Add Github Actions IP to Security group - run: | - aws ec2 authorize-security-group-ingress --group-id ${{ secrets.EC2_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32 - + - name: Get Github Actions IP id: ip uses: haythem/public-ip@v1.2 @@ -51,7 +48,11 @@ jobs: aws-access-key-id: ${{ secrets.EC2_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.EC2_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.EC2_REGION }} - + + - name: Add Github Actions IP to Security group + run: | + aws ec2 authorize-security-group-ingress --group-id ${{ secrets.EC2_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32 + - name: Deploy to EC2 uses: appleboy/ssh-action@master with: