name: Deploy Backend to Testing Environment on: push: branches: - develop permissions: contents: read concurrency: group: deploy-develop cancel-in-progress: false jobs: test: uses: ./.github/workflows/ci.yml secrets: WIZ_SENSOR_TOKEN: ${{ secrets.WIZ_SENSOR_TOKEN }} release_to_sg_region: runs-on: ubuntu-latest needs: test permissions: contents: read id-token: write steps: - name: Wiz sensor uses: Web3Auth/.github/.github/actions/wiz-sensor@545f7c255313f85d38a02dc36c4ad01387d03149 # v1.0.0 with: enabled: ${{ vars.WIZ_SENSOR_ENABLED }} token: ${{ secrets.WIZ_SENSOR_TOKEN }} - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0 with: role-to-assume: ${{ vars.AWS_ROLE_ARN }} aws-region: ${{ secrets.AWS_REGION_SING }} - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2.1.7 - name: Build, tag, and push image to Amazon ECR env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: fetch-node-details-lrc IMAGE_TAG: latest run: | docker build -t "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" -t "$ECR_REGISTRY/$ECR_REPOSITORY:$GITHUB_SHA" . echo "Pushing image to ECR..." docker push "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" docker push "$ECR_REGISTRY/$ECR_REPOSITORY:$GITHUB_SHA" - name: Deploy Testing env timeout-minutes: 10 run: | aws ecs update-service --cluster "$ECS_CLUSTER_FND" --service "$ECS_SERVICE_FND" --force-new-deployment aws ecs wait services-stable --cluster "$ECS_CLUSTER_FND" --service "$ECS_SERVICE_FND" env: ECS_CLUSTER_FND: lrc-microservices ECS_SERVICE_FND: fnd-server-lrc