From da80de3b29c1da02bda8b1f6a644456ff1785844 Mon Sep 17 00:00:00 2001 From: why-only-english <6813821@tukorea.ac.kr> Date: Mon, 17 Jun 2024 16:53:22 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20gradle=20=EA=B6=8C=ED=95=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d7745ce..31916c0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,9 @@ jobs: - name: Verify Java version run: java -version + - name: Grant execute permission for Gradlew + run: chmod +x ./gradlew + - name: Build backend run: | ./gradlew clean build # Use './mvnw clean install' if you are using Maven @@ -27,8 +30,8 @@ jobs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: \${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: \${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: $AWS_REGION - name: Login to Amazon ECR @@ -38,18 +41,18 @@ jobs: - name: Get image tag (version) id: image run: | - VERSION=\$(echo \${{ github.sha }} | cut -c1-8) - echo VERSION=\$VERSION - echo "::set-output name=version::\$VERSION" + VERSION=$(echo ${{ github.sha }} | cut -c1-8) + echo VERSION=$VERSION + echo "::set-output name=version::$VERSION" - name: Build, tag, and push image to Amazon ECR id: image-info env: - ECR_REGISTRY: \${{ steps.login-ecr.outputs.registry }} + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: demo-moreview-backend - IMAGE_TAG: \${{ steps.image.outputs.version }} + IMAGE_TAG: ${{ steps.image.outputs.version }} run: | - echo "::set-output name=ecr_repository::\$ECR_REPOSITORY" - echo "::set-output name=image_tag::\$IMAGE_TAG" - docker build -t \$ECR_REGISTRY/\$ECR_REPOSITORY:\$IMAGE_TAG . - docker push \$ECR_REGISTRY/\$ECR_REPOSITORY:\$IMAGE_TAG \ No newline at end of file + echo "::set-output name=ecr_repository::$ECR_REPOSITORY" + echo "::set-output name=image_tag::$IMAGE_TAG" + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG