How do I trigger aws-ecr/build-and-push-image on every merge into master?

I keep running into build errors with the following file and not sure how to correct it:

orbs:
  aws-ecr: circleci/aws-ecr@7.0.0

workflows:
  build-and-test-app:
    jobs:
      - build-and-test-flask
  build_and_push_image:
    jobs:
      - aws-ecr/build-and-push-image:
          account-url: MY_ID.dkr.ecr.MY_REGION.amazonaws.com
          aws-access-key-id: MY_ACCESS_KEY
          aws-secret-access-key: MY_SECRET_KEY
          region: MY_REGION
          dockerfile: Dockerfile
          path: ./app
          repo: flask-repo
          tag: latest
        requires:
          - build-and-test-flask
        filters:
          branches:
            only: master

As mentioned in the title, I’d like to build and push my Flask app’s Docker image on each merge into master - is there a way to do this?

Fixed this myself :slight_smile: :

workflows:
  build_and_push_image:
    jobs:
      - aws-ecr/build-and-push-image:
          filters:
            branches:
              only: master
          account-url: AWS_ACCOUNT_URL
          aws-access-key-id: AWS_ACCESS_KEY_ID
          aws-secret-access-key: AWS_SECRET_ACCESS_KEY
          region: AWS_DEFAULT_REGION
          dockerfile: Dockerfile
          path: ./path_to_dockerfile
          repo: name_of_repo
          tag: latest
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.