From be28343a84a9279756772b6d4a98e56c3ac6040d Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 22 Aug 2024 07:40:38 +0300 Subject: [PATCH] chore:throtting --- .github/workflows/deploy.yml | 91 ++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 41 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 18f025e..eb9e157 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,6 @@ name: Deploy to AWS App Runner -# Trigger this workflow on any push to the 'main' branch +# Trigger this workflow on any push to the 'master' branch on: push: branches: @@ -13,44 +13,49 @@ jobs: runs-on: ubuntu-latest # Run on the latest version of Ubuntu steps: - # Step 1: Checkout the code from the repository - - name: Checkout code - uses: actions/checkout@v3 # GitHub Action to checkout the code + # Step 1: Check out the code from the repository + - name: Check out code + uses: actions/checkout@v3 # GitHub Action to check out the code - # Step 2: Set up AWS CLI with necessary credentials - - name: Set up AWS CLI - uses: aws-actions/configure-aws-credentials@v2 # GitHub Action to configure AWS credentials - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} # AWS Access Key ID stored as a GitHub secret - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # AWS Secret Access Key stored as a GitHub secret - aws-region: us-east-1 # AWS Region stored as a GitHub secret + # Step 2: Set up AWS CLI with necessary credentials + - name: Set up AWS CLI + uses: aws-actions/configure-aws-credentials@v2 # GitHub Action to configure AWS credentials + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} # AWS Access Key ID stored as a GitHub secret + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # AWS Secret Access Key stored as a GitHub secret + aws-region: us-east-1 # AWS Region stored as a GitHub secret - # Step 3: Deploy the backend service to AWS App Runner - - name: Deploy Backend - run: | - 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 <