From d87347e04ae9c42738bde3434fb3430f2979cf5d Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 22 Aug 2024 05:41:05 +0300 Subject: [PATCH] chore:deploy --- .github/workflows/deploy.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9f2ab21..67c8309 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,15 +28,17 @@ jobs: # Step 3: Deploy the backend service to AWS App Runner - name: Deploy Backend run: | - # AWS CLI command to update the backend service in AWS App Runner - aws apprunner update-service \ - --service-arn $(aws apprunner list-services --query "ServiceSummaryList[?ServiceName=='${{ secrets.APP_RUNNER_SERVICE_NAME_BACKEND }}'].ServiceArn | [0]" --output text) \ - --source-configuration SourceCodeRepository={"RepositoryUrl": "${{ secrets.REPOSITORY_URL }}", "SourceCodeVersion": {"Type": "BRANCH", "Value": "master"}, "SourceDirectory": "/linguaphoto"} - SERVICE_ARN=$(aws apprunner list-services --query "ServiceSummaryList[?ServiceName=='${{ secrets.APP_RUNNER_SERVICE_NAME_BACKEND }}'].ServiceArn | [0]" --output text) + + if [ -z "$SERVICE_ARN" ]; then + echo "Error: Service ARN not found for service name ${{ secrets.APP_RUNNER_SERVICE_NAME_BACKEND }}." + exit 1 + fi + + # Update the backend service in AWS App Runner aws apprunner update-service \ - --service-arn "$SERVICE_ARN" \ - --source-configuration "$(cat <