From 19391cc62487a5c0b77e09b7ee9347c46410bbc6 Mon Sep 17 00:00:00 2001 From: Minjae Kim Date: Wed, 18 May 2022 17:27:41 +0900 Subject: [PATCH] add dockerfile and build path --- action.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index d45c747..3196da8 100644 --- a/action.yml +++ b/action.yml @@ -4,12 +4,12 @@ inputs: ecr-repo: description: "ECR Repository" required: true - ecs-service: - description: "ECS Service" - required: true ecs-cluster: description: "ECS Cluster" required: true + ecs-service: + description: "ECS Service" + required: true task-definition: description: "ECS Service task definition" required: true @@ -22,6 +22,14 @@ inputs: aws-region: description: "AWS Region" required: true + dockerfile: + description: "Dockerfile" + required: false + default: "./Dockerfile" + build-path: + description: "Docker build path" + required: false + default: "." runs: using: "composite" @@ -45,7 +53,7 @@ runs: TAG: ${{ github.sha }} shell: bash run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$TAG . + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$TAG -f ${{ inputs.dockerfile }} ${{ inputs.build-path }} docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest docker push $ECR_REGISTRY/$ECR_REPOSITORY:$TAG docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest @@ -75,6 +83,7 @@ runs: container-name: ${{ steps.container-name.outputs.name }} image: ${{ steps.build-image.outputs.image }} + # https://github.com/aws-actions/amazon-ecs-deploy-task-definition/issues/176 - name: Deploy Amazon ECS task definition uses: aws-actions/amazon-ecs-deploy-task-definition@v1 with: