From 00ffcd5b4bd3ec3d2f5f39662b9998a7e273119c Mon Sep 17 00:00:00 2001 From: Sumin Hwang <163857590+tnals0924@users.noreply.github.com> Date: Thu, 8 Jan 2026 00:09:17 +0900 Subject: [PATCH 1/5] =?UTF-8?q?chore:=20=EB=82=B4=EB=B6=80=EC=84=9C?= =?UTF-8?q?=EB=B2=84=20=EB=B0=B0=ED=8F=AC=20=ED=8C=8C=EC=9D=B4=ED=94=84?= =?UTF-8?q?=EB=9D=BC=EC=9D=B8=20=EA=B5=AC=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/autoReviewers.yml | 14 ------- .github/workflows/autoSync-develop.yml | 32 ---------------- .github/workflows/autoSync-main.yml | 32 ---------------- .github/workflows/deploy-dev.yml | 50 +++++++++++++++++++++++++ .github/workflows/deploy-prod.yml | 51 ++++++++++++++++++++++++++ Dockerfile | 30 +++++++++++++++ 6 files changed, 131 insertions(+), 78 deletions(-) delete mode 100644 .github/workflows/autoReviewers.yml delete mode 100644 .github/workflows/autoSync-develop.yml delete mode 100644 .github/workflows/autoSync-main.yml create mode 100644 .github/workflows/deploy-dev.yml create mode 100644 .github/workflows/deploy-prod.yml create mode 100644 Dockerfile diff --git a/.github/workflows/autoReviewers.yml b/.github/workflows/autoReviewers.yml deleted file mode 100644 index fbca91e..0000000 --- a/.github/workflows/autoReviewers.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Review Assign - -on: - pull_request: - types: [opened, ready_for_review] - -jobs: - assign: - runs-on: ubuntu-latest - steps: - - uses: hkusu/review-assign-action@v1 - with: - assignees: ${{ github.actor }} - reviewers: sinji2102, hyeonjin6530, daun-up diff --git a/.github/workflows/autoSync-develop.yml b/.github/workflows/autoSync-develop.yml deleted file mode 100644 index 1df8e65..0000000 --- a/.github/workflows/autoSync-develop.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: (Develop) Synchronize to forked repo -on: - push: - branches: - - develop - -jobs: - sync: - name: Sync forked repo - runs-on: ubuntu-latest - - steps: - - name: Checkout develop - uses: actions/checkout@v4 - with: - token: ${{ secrets.DEV_AUTO_SYNC_TOKEN }} - fetch-depth: 0 - ref: develop - - - name: Add remote-url - run: | - git remote add forked-repo https://hyeonjin6530:${{ secrets.DEV_AUTO_SYNC_TOKEN }}@github.com/hyeonjin6530/billilge-frontend - git config user.name hyeonjin6530 - git config user.email ${{ secrets.DEV_EMAIL }} - - - name: Push changes to forked-repo - run: | - git push -f forked-repo develop - - - name: Clean up - run: | - git remote remove forked-repo diff --git a/.github/workflows/autoSync-main.yml b/.github/workflows/autoSync-main.yml deleted file mode 100644 index f5f1a89..0000000 --- a/.github/workflows/autoSync-main.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: (Main) Synchronize to forked repo -on: - push: - branches: - - main - -jobs: - sync: - name: Sync forked repo - runs-on: ubuntu-latest - - steps: - - name: Checkout main - uses: actions/checkout@v4 - with: - token: ${{ secrets.AUTO_SYNC_TOKEN }} - fetch-depth: 0 - ref: main - - - name: Add remote-url - run: | - git remote add forked-repo https://tnals0924:${{ secrets.AUTO_SYNC_TOKEN }}@github.com/tnals0924/billilge-frontend - git config user.name tnals0924 - git config user.email ${{ secrets.EMAIL }} - - - name: Push changes to forked-repo - run: | - git push -f forked-repo main - - - name: Clean up - run: | - git remote remove forked-repo diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000..f291298 --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,50 @@ +name: Deploy to Development + +on: + push: + branches: + - chore/#142-cicd-migration + +env: + DOCKER_IMAGE: ${{ secrets.DOCKER_USERNAME }}/billilge-client + CAPROVER_APP: dev + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + environment: development + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create .env file + run: echo "${{ secrets.DEV_ENV_FILE }}" > .env.production + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ${{ env.DOCKER_IMAGE }}:dev + ${{ env.DOCKER_IMAGE }}:dev-${{ github.sha }} + cache-from: type=gha,scope=dev + cache-to: type=gha,mode=max,scope=dev + + - name: Deploy to CapRover + uses: caprover/deploy-from-github@v1.1.2 + with: + server: ${{ secrets.CAPROVER_SERVER }} + app: ${{ env.CAPROVER_APP }} + token: ${{ secrets.CAPROVER_DEV_APP_TOKEN }} + image: ${{ env.DOCKER_IMAGE }}:dev diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml new file mode 100644 index 0000000..cf00e9a --- /dev/null +++ b/.github/workflows/deploy-prod.yml @@ -0,0 +1,51 @@ +name: Deploy to Production + +on: + push: + branches: + - main + +env: + DOCKER_IMAGE: ${{ secrets.DOCKER_USERNAME }}/billilge-client + CAPROVER_APP: app + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create .env file + run: echo "${{ secrets.PROD_ENV_FILE }}" > .env.production + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ${{ env.DOCKER_IMAGE }}:prod + ${{ env.DOCKER_IMAGE }}:prod-${{ github.sha }} + ${{ env.DOCKER_IMAGE }}:latest + cache-from: type=gha,scope=prod + cache-to: type=gha,mode=max,scope=prod + + - name: Deploy to CapRover + uses: caprover/deploy-from-github@v1.1.2 + with: + server: ${{ secrets.CAPROVER_SERVER }} + app: ${{ env.CAPROVER_APP }} + token: ${{ secrets.CAPROVER_PROD_APP_TOKEN }} + image: ${{ env.DOCKER_IMAGE }}:prod diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..25268fd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# Build stage +FROM node:20-alpine AS builder +WORKDIR /app + +COPY package.json yarn.lock ./ +RUN yarn install --frozen-lockfile + +COPY . . +RUN yarn build + +# Production stage +FROM node:20-alpine AS runner +WORKDIR /app + +ENV NODE_ENV=production + +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs + +COPY --from=builder /app/public ./public +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + +USER nextjs + +EXPOSE 3000 +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" + +CMD ["node", "server.js"] From 0e9cb64a50f34608987bf8673452cf3b7a7237bc Mon Sep 17 00:00:00 2001 From: Sumin Hwang <163857590+tnals0924@users.noreply.github.com> Date: Thu, 8 Jan 2026 00:13:28 +0900 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20docker=20yarn=20install=20=ED=9B=84?= =?UTF-8?q?=EC=97=90=20husky=20=EC=9E=91=EB=8F=99=ED=95=98=EB=8D=98=20?= =?UTF-8?q?=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 25268fd..e5b83fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM node:20-alpine AS builder WORKDIR /app COPY package.json yarn.lock ./ -RUN yarn install --frozen-lockfile +RUN yarn install --frozen-lockfile --ignore-scripts COPY . . RUN yarn build From 9740edcc30073332f22e7f52adcaec973ef04f21 Mon Sep 17 00:00:00 2001 From: Sumin Hwang <163857590+tnals0924@users.noreply.github.com> Date: Thu, 8 Jan 2026 00:17:47 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=EB=B9=8C=EB=93=9C=20=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=20standalone=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/next.config.mjs b/next.config.mjs index 997e55c..4e570a6 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -12,6 +12,7 @@ const nextConfig = withPWA({ DB_NAME: process.env.DB_NAME, }, reactStrictMode: true, + output: 'standalone', swcMinify: true, async redirects() { return [ From 57a3dc0a8034c5f1c49d7fdf3d06b5df01642e25 Mon Sep 17 00:00:00 2001 From: Sumin Hwang <163857590+tnals0924@users.noreply.github.com> Date: Thu, 8 Jan 2026 00:18:01 +0900 Subject: [PATCH 4/5] =?UTF-8?q?chore:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EB=8F=84=EB=A9=94=EC=9D=B8=20=EB=82=B4=EB=B6=80=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=84=9C=EB=B2=84=20=EB=8F=84=EB=A9=94=EC=9D=B8?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/next.config.mjs b/next.config.mjs index 4e570a6..fd580d6 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -35,7 +35,7 @@ const nextConfig = withPWA({ images: { domains: [ 'github.com', - 'billilge-resources.s3.us-west-2.amazonaws.com', // S3 이미지 도메인 추가 + 'minio-api.billilge.site', // 파일서버 이미지 도메인 추가 ], dangerouslyAllowSVG: true, contentSecurityPolicy: "default-src 'self'; img-src 'self' data: https:;", From e01d78d7621634a3967f59670677133bf0c32d75 Mon Sep 17 00:00:00 2001 From: Sumin Hwang <163857590+tnals0924@users.noreply.github.com> Date: Thu, 8 Jan 2026 00:26:02 +0900 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20=EA=B0=9C=EB=B0=9C=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20=EB=B0=B0=ED=8F=AC=20=ED=8C=8C=EC=9D=B4=ED=94=84?= =?UTF-8?q?=EB=9D=BC=EC=9D=B8=20=EB=B8=8C=EB=9E=9C=EC=B9=98=20develop?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index f291298..efcf325 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -3,7 +3,7 @@ name: Deploy to Development on: push: branches: - - chore/#142-cicd-migration + - develop env: DOCKER_IMAGE: ${{ secrets.DOCKER_USERNAME }}/billilge-client