From bf80da4514e9beaa3d2f6d757b97b4b2da95a2c5 Mon Sep 17 00:00:00 2001 From: IsaacAndra Date: Wed, 18 Sep 2024 14:46:01 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Integra=C3=A7=C3=A3o=20Cont=C3=ADnua=20?= =?UTF-8?q?com=20Amazon=20ECR=20e=20ECS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-app.yml | 19 +++++++++++++++++++ .../blog/config/OpenApiConfig.java | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-app.yml b/.github/workflows/ci-app.yml index 763ebd9..3478fd0 100644 --- a/.github/workflows/ci-app.yml +++ b/.github/workflows/ci-app.yml @@ -65,6 +65,25 @@ jobs: docker push ${{ secrets.IMAGE_REPO_URL }}:${{ github.run_id }} docker push ${{ secrets.IMAGE_REPO_URL }}:latest + - name: Download task definition + run: | + aws ecs describe-task-definition --task-definition ${{ secrets.TASK_DEFINITION_NAME }} --query taskDefinition > task-definition.json + + - name: Fill in the new image ID in the Amazon ECS task definition + id: task-def + uses: aws-actions/amazon-ecs-render-task-definition@v1 + with: + task-definition: task-definition.json + container-name: ${{ secrets.CONTAINER_NAME }} + image: ${{ secrets.IMAGE_REPO_URL }}:latest + + - name: Deploy Amazon ECS task definition + uses: aws-actions/amazon-ecs-deploy-task-definition@v2 + with: + task-definition: ${{ steps.task-def.outputs.task-definition }} + service: ${{ secrets.SERVICE_NAME }} + cluster: ${{ secrets.CLUSTER_NAME }} + wait-for-service-stability: true - name: Push to Docker Hub Container Registry run: | diff --git a/src/main/java/com/isaacandrade/blog/config/OpenApiConfig.java b/src/main/java/com/isaacandrade/blog/config/OpenApiConfig.java index ffb1cf9..532a7ee 100644 --- a/src/main/java/com/isaacandrade/blog/config/OpenApiConfig.java +++ b/src/main/java/com/isaacandrade/blog/config/OpenApiConfig.java @@ -1,6 +1,5 @@ package com.isaacandrade.blog.config; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; @@ -17,7 +16,7 @@ public class OpenApiConfig { public OpenAPI customOpenAPI(){ return new OpenAPI() .info(new Info() - .title("Restful API with Java 17 and Spring Boot 3") + .title("Restful API with Java 17 and Spring Boot 3 - Foo") .version("v1") .description("API of Isaac Andrade's Website") .termsOfService("/")