From fb4032f9a55e95ff0b6d63985054ac67445c36ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=99=ED=99=98?= <115167094+rlaDonghwan@users.noreply.github.com> Date: Mon, 2 Jun 2025 01:18:38 +0900 Subject: [PATCH 1/9] Create frontend.yml --- .github/workflows/frontend.yml | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/frontend.yml diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml new file mode 100644 index 0000000..8bf9aca --- /dev/null +++ b/.github/workflows/frontend.yml @@ -0,0 +1,54 @@ +name: Build and Deploy Frontend to EKS + +on: + push: + branches: [ main ] + paths: + - 'frontend/**' + - 'deployment.yaml' + - '.github/workflows/frontend-cicd.yml' + +jobs: + build-and-deploy-frontend: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker Image + run: | + docker buildx build \ + --platform linux/amd64 \ + -t ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest \ + --push ./frontend + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ap-northeast-2 + + - name: Update kubeconfig for EKS + run: | + aws eks update-kubeconfig \ + --region ap-northeast-2 \ + --name nsmm-eks + + - name: Replace image tag in deployment.yaml + run: | + sed -i "s|image: .*frontend-service.*|image: ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest|g" deployment.yaml + + - name: Deploy to EKS + run: | + kubectl apply -f deployment.yaml From e49d45c2baf1594f8603f2042493fc52b598fa48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=99=ED=99=98?= <115167094+rlaDonghwan@users.noreply.github.com> Date: Mon, 2 Jun 2025 11:48:48 +0900 Subject: [PATCH 2/9] Update frontend.yml --- .github/workflows/frontend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 8bf9aca..6a55dea 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -30,7 +30,7 @@ jobs: docker buildx build \ --platform linux/amd64 \ -t ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest \ - --push ./frontend + --push . - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 From e222fc1e9ff934bae4946218ed6d6b8926f47421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=99=ED=99=98?= <115167094+rlaDonghwan@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:03:23 +0900 Subject: [PATCH 3/9] Update frontend.yml --- .github/workflows/frontend.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 6a55dea..1020d57 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -5,7 +5,6 @@ on: branches: [ main ] paths: - 'frontend/**' - - 'deployment.yaml' - '.github/workflows/frontend-cicd.yml' jobs: @@ -13,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout Repository uses: actions/checkout@v3 - name: Set up Docker Buildx @@ -25,12 +24,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and Push Docker Image + - name: Build and Push Docker Image to DockerHub run: | docker buildx build \ --platform linux/amd64 \ -t ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest \ - --push . + --push ./frontend - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -45,10 +44,14 @@ jobs: --region ap-northeast-2 \ --name nsmm-eks - - name: Replace image tag in deployment.yaml + - name: Replace Image Tag in frontend/deployment.yaml run: | - sed -i "s|image: .*frontend-service.*|image: ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest|g" deployment.yaml + sed -i "s|image: .*frontend-service.*|image: ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest|g" frontend/deployment.yaml - - name: Deploy to EKS + - name: Deploy frontend to EKS run: | - kubectl apply -f deployment.yaml + kubectl apply -f frontend/deployment.yaml + + - name: Verify Deployment + run: | + kubectl rollout status deployment/frontend-service From 4788f788cfa286e7028fe553bb85454053136c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=99=ED=99=98?= <115167094+rlaDonghwan@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:03:53 +0900 Subject: [PATCH 4/9] Create main.yml --- .github/workflows/main.yml | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1020d57 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,57 @@ +name: Build and Deploy Frontend to EKS + +on: + push: + branches: [ main ] + paths: + - 'frontend/**' + - '.github/workflows/frontend-cicd.yml' + +jobs: + build-and-deploy-frontend: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker Image to DockerHub + run: | + docker buildx build \ + --platform linux/amd64 \ + -t ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest \ + --push ./frontend + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ap-northeast-2 + + - name: Update kubeconfig for EKS + run: | + aws eks update-kubeconfig \ + --region ap-northeast-2 \ + --name nsmm-eks + + - name: Replace Image Tag in frontend/deployment.yaml + run: | + sed -i "s|image: .*frontend-service.*|image: ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest|g" frontend/deployment.yaml + + - name: Deploy frontend to EKS + run: | + kubectl apply -f frontend/deployment.yaml + + - name: Verify Deployment + run: | + kubectl rollout status deployment/frontend-service From 73e5ac3354e1ac2e851a723c4b89a9869d519ae5 Mon Sep 17 00:00:00 2001 From: donghwan Date: Mon, 2 Jun 2025 12:04:53 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/partnerCompany.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/partnerCompany.ts b/src/services/partnerCompany.ts index c485070..68eca92 100644 --- a/src/services/partnerCompany.ts +++ b/src/services/partnerCompany.ts @@ -12,7 +12,7 @@ export interface PartnerCompany { stock_code?: string // 주식 코드 contract_start_date?: string // 계약 시작일 (API 응답 필드 - YYYY-MM-DD 문자열) modify_date?: string // 수정일 - // 프론트엔드에서 사용할 필드 (API 응답을 변환하여 채움) + // 프론트엔드에서 사용할 필드 (API 응답을 변환하여 채움)............... companyName: string contractStartDate: Date } From e477024eb0c6dc1d5931d5e98e691b4339e24882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=99=ED=99=98?= <115167094+rlaDonghwan@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:06:10 +0900 Subject: [PATCH 6/9] Update frontend.yml --- .github/workflows/frontend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 1020d57..f234140 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -5,7 +5,7 @@ on: branches: [ main ] paths: - 'frontend/**' - - '.github/workflows/frontend-cicd.yml' + - '.github/workflows/frontend.yml' jobs: build-and-deploy-frontend: From 79c169c04b039689853d67a5190aafb4d1994b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=99=ED=99=98?= <115167094+rlaDonghwan@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:06:57 +0900 Subject: [PATCH 7/9] Update frontend.yml --- .github/workflows/frontend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index f234140..1ea305d 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -29,7 +29,7 @@ jobs: docker buildx build \ --platform linux/amd64 \ -t ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest \ - --push ./frontend + --push . - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 From 9db570481cbf7bff62e2672926b6f0dad090e153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=99=ED=99=98?= <115167094+rlaDonghwan@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:12:47 +0900 Subject: [PATCH 8/9] Update and rename frontend.yml to frontend-cicd.yml --- .../workflows/{frontend.yml => frontend-cicd.yml} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename .github/workflows/{frontend.yml => frontend-cicd.yml} (82%) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend-cicd.yml similarity index 82% rename from .github/workflows/frontend.yml rename to .github/workflows/frontend-cicd.yml index 1ea305d..66a6c86 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend-cicd.yml @@ -4,8 +4,8 @@ on: push: branches: [ main ] paths: - - 'frontend/**' - - '.github/workflows/frontend.yml' + - '**' + - '.github/workflows/frontend-cicd.yml' jobs: build-and-deploy-frontend: @@ -44,13 +44,13 @@ jobs: --region ap-northeast-2 \ --name nsmm-eks - - name: Replace Image Tag in frontend/deployment.yaml + - name: Replace Image Tag in deployment.yaml run: | - sed -i "s|image: .*frontend-service.*|image: ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest|g" frontend/deployment.yaml + sed -i "s|image: .*frontend-service.*|image: ${{ secrets.DOCKERHUB_USERNAME }}/frontend-service:latest|g" deployment.yaml - - name: Deploy frontend to EKS + - name: Deploy to EKS run: | - kubectl apply -f frontend/deployment.yaml + kubectl apply -f deployment.yaml - name: Verify Deployment run: | From 99aa30d1880be3c0cb30a8b8c06cc6207be9028c Mon Sep 17 00:00:00 2001 From: donghwan Date: Mon, 2 Jun 2025 12:18:51 +0900 Subject: [PATCH 9/9] =?UTF-8?q?refactor=20:=20deployment=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployment.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/deployment.yaml b/deployment.yaml index 0fde9de..f36a88f 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -12,11 +12,6 @@ spec: labels: app: frontend-service spec: - tolerations: - - key: "eks.amazonaws.com/compute-type" - operator: "Equal" - value: "fargate" - effect: "NoSchedule" containers: - name: frontend-service image: kdonghwan/frontend-service:latest