Deploy Image to Amazon ECS service

Viewed 113

I am using Github actions to build and deploy docker images to Amazon ECS.

This is the code I used when the action runs:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Build and push Docker images
        uses: docker/build-push-action@v1
        with:
          username: ***
          password: ***
          registry: ***
          repository: ***
          tags: ***
          tag_with_ref: true

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ***
          aws-secret-access-key: ***
          aws-region: ***

      - name: Render Amazon ECS task definition
        id: render-api-container
        uses: aws-actions/amazon-ecs-render-task-definition@v1
        with:
          task-definition: ***
          container-name: ***
          image: docker.pkg.github.com/company/repo/image:***

      - name: Deploy to Amazon ECS service
        uses: aws-actions/amazon-ecs-deploy-task-definition@v1
        with:
          task-definition: ${{ steps.render-api-container.outputs.task-definition }}
          service: ***
          cluster: ***

The job runs without errors, but I get this error from Amazon task starts: ECS Error

The image was built and deployed to our organization's GitHub packages.

I checked "Auto-assign Public IP" and it is enabled.

The last successful task that was run on Amazon was on February 8.

0 Answers
Related