Skip to content

Commit

Permalink
액션 태스트 커밋1
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Jan 8, 2025
1 parent 0d16ab8 commit 9a61298
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/ecs-dev-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- dev
workflow_dispatch:

env:
AWS_REGION: ap-northeast-2
ECR_REPOSITORY: few-ecr
Expand Down Expand Up @@ -67,25 +68,31 @@ jobs:
GIT_HASH=$(git rev-parse --short HEAD)
./gradlew buildEcsDockerImage -PimageName=${ECR_REGISTRY}/${ECR_REPOSITORY}:latest
docker tag ${ECR_REGISTRY}/${ECR_REPOSITORY}:latest ${ECR_REGISTRY}/${ECR_REPOSITORY}:${GIT_HASH}
docker push ${ECR_REGISTRY}/${ECR_REPOSITORY} --all-tags
docker push ${ECR_REGISTRY}/${ECR_REPOSITORY}:latest
docker push ${ECR_REGISTRY}/${ECR_REPOSITORY}:${GIT_HASH}
- name: Get ECR Repository image path
id: get-docker-image-path
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
GIT_HASH=$(git rev-parse --short HEAD)
echo ${ECR_REGISTRY}/${ECR_REPOSITORY}:${GIT_HASH}
echo "::set-output name=image::${ECR_REGISTRY}/${ECR_REPOSITORY}:${GIT_HASH}"
echo "IMAGE_PATH=${ECR_REGISTRY}/${ECR_REPOSITORY}:${GIT_HASH}" >> $GITHUB_ENV
- name: Download task definition
run: |
aws ecs describe-task-definition --task-definition ${TASK_DEFINITION_NAME} --query taskDefinition > task-definition.json
aws ecs describe-task-definition \
--task-definition ${TASK_DEFINITION_NAME} \
--query 'taskDefinition' \
> ${env.ECS_TASK_DEFINITION}
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-definition
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.get-docker-image-path.outputs.image }}
image: ${{ env.IMAGE_PATH }}

- name: Deploy Amazon ECS task definition
id: ecs-deployment
Expand Down

0 comments on commit 9a61298

Please sign in to comment.