Need help with Create image and deploy to AWS ECR

Hello All,

I am a Scala developer, and really new to CI/CD. :frowning: Can anyone please help what I am missing by looking at the yml file.

I have scala/sbt project in Github, that need to be built using CircleCI, create as container and deploy to AWS ECR.

  1. Build ( able to achieve)
  2. Creating docker Container & deploy (PROBLEM !!! need help here)

======


version: 2.1
orbs:
  aws-ecr: circleci/aws-ecr@8.2.1
  aws-ecs: circleci/aws-ecs@3.2.0

jobs:
  build:
    docker:
      - image: circleci/openjdk:8-jdk
    working_directory: ~/src
    steps:
      - checkout
      - run: sbt compile
  push:
    #      requires:
    #        - build
    docker:
      # replace with your preferred image
      # - image: cimg/base:stable
      - image: cimg/base:stable
      - image: circleci/openjdk:8-jdk
    steps:
      - aws-ecr/push-image:
          public-registry: false
          region: AWS_DEFAULT_REGION
          repo: dev-baas-ecr-repo/backend
          registry-id: AWS_ECR_REGISTRY_ID

workflows:
  version: 2
  build-and-deploy:
    jobs:
      - build
      - push:
          requires:
            - build
      - aws-ecs/deploy-service-update:
          requires:
            - push
          aws-region: AWS_DEFAULT_REGION
          aws-access-key-id: AWS_ACCESS_KEY_ID
          aws-secret-access-key: AWS_SECRET_ACCESS_KEY
          cluster: dev-baas-Cluster
          container-image-name-updates: dev-baas-ecrrepo/backend:$CIRCLE_SHA1
          family: dev-baas-TaskDef
          filters:
            branches:
              only: main