From 15c8615053d665937f44bb565341ebce1b2ba7c8 Mon Sep 17 00:00:00 2001 From: charlie3965 Date: Wed, 11 Feb 2026 02:09:10 +0900 Subject: [PATCH 1/6] removed unnecessary features from workflow --- .../{docker-image.yaml => deploy.yaml} | 12 ++++---- .github/workflows/dev.yaml | 28 +++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) rename .github/workflows/{docker-image.yaml => deploy.yaml} (55%) create mode 100644 .github/workflows/dev.yaml diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/deploy.yaml similarity index 55% rename from .github/workflows/docker-image.yaml rename to .github/workflows/deploy.yaml index c6adab1..d0224ee 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/deploy.yaml @@ -16,13 +16,13 @@ jobs: - name: Build and tag Docker image run: | - docker build --no-cache -t ${{ secrets.DOCKER_HUB_USERNAME }}/kws_fe:latest . - docker tag ${{ secrets.DOCKER_HUB_USERNAME }}/kws_fe:latest ${{ secrets.DOCKER_HUB_USERNAME }}/kws_fe:latest + docker build --no-cache -t fe_deploy . + docker tag fe_deploy fe_deploy:latest - name: Deploy container locally run: | - IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/kws_fe:latest - docker stop KWS_FE || true - docker rm KWS_FE || true - docker run -d --name KWS_FE -p 25120:80 $IMAGE + IMAGE=fe_deploy:latest + docker stop FE_DEPLOY || true + docker rm FE_DEPLOY || true + docker run -d --name FE_DEPLOY -p 25120:80 $IMAGE docker system prune -af diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml new file mode 100644 index 0000000..b32ee02 --- /dev/null +++ b/.github/workflows/dev.yaml @@ -0,0 +1,28 @@ +name: Build and Deploy Docker Image + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: self-hosted # 로컬 Ubuntu의 actions 계정에서 실행됨 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build and tag Docker image + run: | + docker build --no-cache -t fe_dev . + docker tag fe_dev fe_dev:latest + + - name: Deploy container locally + run: | + IMAGE=fe_dev:latest + docker stop FE_DEV || true + docker rm FE_DEV || true + docker run -d --name FE_DEV -p 25119:80 $IMAGE + docker system prune -af From aabbf2dc2aae6d5e214473e6ce13ae76d3d44fda Mon Sep 17 00:00:00 2001 From: charlie3965 Date: Wed, 11 Feb 2026 02:10:52 +0900 Subject: [PATCH 2/6] changed workflow name --- .github/workflows/deploy.yaml | 2 +- .github/workflows/dev.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d0224ee..0ddb04e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: Build and Deploy Docker Image +name: Deploy Doddle Frontend on: push: diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index b32ee02..ca3d389 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -1,9 +1,9 @@ -name: Build and Deploy Docker Image +name: DEV Deploy Doddle Frontend on: push: branches: - - main + - dev workflow_dispatch: jobs: From b34fee04224bc928df17879477f8e05f5444f22c Mon Sep 17 00:00:00 2001 From: charlie3965 Date: Wed, 11 Feb 2026 02:16:13 +0900 Subject: [PATCH 3/6] fixed api domain as environment variable --- .github/workflows/deploy.yaml | 4 ++-- .github/workflows/dev.yaml | 4 ++-- Dockerfile | 3 +++ src/services/api.ts | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0ddb04e..89bd560 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -8,7 +8,7 @@ on: jobs: build-and-deploy: - runs-on: self-hosted # 로컬 Ubuntu의 actions 계정에서 실행됨 + runs-on: self-hosted steps: - name: Checkout code @@ -16,7 +16,7 @@ jobs: - name: Build and tag Docker image run: | - docker build --no-cache -t fe_deploy . + docker build --no-cache --build-arg API_DOMAIN=${{ secrets.API_DOMAIN_DEPLOY }} -t fe_deploy . docker tag fe_deploy fe_deploy:latest - name: Deploy container locally diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index ca3d389..4620bf0 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -8,7 +8,7 @@ on: jobs: build-and-deploy: - runs-on: self-hosted # 로컬 Ubuntu의 actions 계정에서 실행됨 + runs-on: self-hosted steps: - name: Checkout code @@ -16,7 +16,7 @@ jobs: - name: Build and tag Docker image run: | - docker build --no-cache -t fe_dev . + docker build --no-cache --build-arg API_DOMAIN=${{ secrets.API_DOMAIN_DEV }} -t fe_dev . docker tag fe_dev fe_dev:latest - name: Deploy container locally diff --git a/Dockerfile b/Dockerfile index 88fdd8e..7d43c5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,9 @@ WORKDIR /app COPY package*.json ./ RUN npm install --legacy-peer-deps +ARG API_DOMAIN +ENV API_DOMAIN=${API_DOMAIN} + # 애플리케이션 코드 복사 및 빌드 COPY . . RUN npm run build diff --git a/src/services/api.ts b/src/services/api.ts index 417d458..b968bc3 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -1,8 +1,10 @@ import axios from "axios"; import Cookies from "js-cookie"; +const API_DOMAIN = import.meta.env.API_DOMAIN; + const axiosClient = axios.create({ - baseURL: "https://doddle.kr/api", + baseURL: "https://${API_DOMAIN}/api", headers: { "Content-Type": "application/json", }, From c443b416fb2d0c6a665a050d422c75507bf83964 Mon Sep 17 00:00:00 2001 From: charlie3965 Date: Wed, 11 Feb 2026 02:21:19 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=EB=88=84=EB=9D=BD=EB=90=9C=20back-quote=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/api.ts b/src/services/api.ts index b968bc3..4d85be2 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -1,10 +1,10 @@ import axios from "axios"; import Cookies from "js-cookie"; -const API_DOMAIN = import.meta.env.API_DOMAIN; +const API_DOMAIN = import.meta.env.VITE_API_DOMAIN; const axiosClient = axios.create({ - baseURL: "https://${API_DOMAIN}/api", + baseURL: `https://${API_DOMAIN}/api`, headers: { "Content-Type": "application/json", }, From 8b63634ecffe4d073b8f30e5c489b659d2af9c22 Mon Sep 17 00:00:00 2001 From: charlie3965 Date: Wed, 11 Feb 2026 02:27:13 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=EC=8B=A4=EC=88=98=EB=A1=9C=20=EC=95=88?= =?UTF-8?q?=EB=B0=94=EA=BE=BC=20=EB=B3=80=EC=88=98=EB=AA=85=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/api.ts b/src/services/api.ts index 4d85be2..1d9eeb8 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -1,7 +1,7 @@ import axios from "axios"; import Cookies from "js-cookie"; -const API_DOMAIN = import.meta.env.VITE_API_DOMAIN; +const API_DOMAIN = import.meta.env.API_DOMAIN; const axiosClient = axios.create({ baseURL: `https://${API_DOMAIN}/api`, From 675ea2889dd0488fe00d8c323da21cb0e0505358 Mon Sep 17 00:00:00 2001 From: charlie3965 Date: Wed, 11 Feb 2026 02:32:36 +0900 Subject: [PATCH 6/6] =?UTF-8?q?VITE=5F=20prefix=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- src/services/api.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d43c5f..72a103c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ COPY package*.json ./ RUN npm install --legacy-peer-deps ARG API_DOMAIN -ENV API_DOMAIN=${API_DOMAIN} +ENV VITE_API_DOMAIN=${API_DOMAIN} # 애플리케이션 코드 복사 및 빌드 COPY . . diff --git a/src/services/api.ts b/src/services/api.ts index 1d9eeb8..4d85be2 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -1,7 +1,7 @@ import axios from "axios"; import Cookies from "js-cookie"; -const API_DOMAIN = import.meta.env.API_DOMAIN; +const API_DOMAIN = import.meta.env.VITE_API_DOMAIN; const axiosClient = axios.create({ baseURL: `https://${API_DOMAIN}/api`,