From 8ca92361176fa6e5a8f403097d785e293056f81b Mon Sep 17 00:00:00 2001 From: Lin Date: Mon, 27 Jan 2025 19:47:10 +0900 Subject: [PATCH 01/30] =?UTF-8?q?Refactor:=20rewrites=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=ED=95=98=EC=97=AC=20PR=20preview=20URL=20?= =?UTF-8?q?=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89=ED=8A=B8=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 --- .github/workflows/preview.yml | 2 +- apps/web/next.config.mjs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 45dd2855..60053766 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -60,4 +60,4 @@ jobs: **Branch:** ${{ github.head_ref }} **Commit:** ${{ github.sha }} - Preview URL: https://codeit.click?pr=${{ github.event.pull_request.number }} + Preview URL: https://codeit.click/pr-${{ github.event.pull_request.number }} diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 1d2ef199..32a2d8c3 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -71,6 +71,17 @@ const nextConfig = { }, }, }, + + async rewrites() { + return { + beforeFiles: [ + { + source: "/pr-:number/:path*", + destination: "/:path*", + }, + ], + }; + }, }; export default nextConfig; From 0fca04ba1006fddc1dce8624f7ad793a667252db Mon Sep 17 00:00:00 2001 From: Lin Date: Mon, 27 Jan 2025 20:13:48 +0900 Subject: [PATCH 02/30] =?UTF-8?q?Fix:=20handleNavigationActions=20props=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/mobile/app/(route)/dashboard.tsx | 5 ++++- apps/mobile/app/(route)/meetings.tsx | 5 ++++- apps/mobile/app/(route)/seats.tsx | 5 ++++- apps/mobile/app/(route)/settings.tsx | 6 +++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/mobile/app/(route)/dashboard.tsx b/apps/mobile/app/(route)/dashboard.tsx index 6e96b635..bf0a8625 100644 --- a/apps/mobile/app/(route)/dashboard.tsx +++ b/apps/mobile/app/(route)/dashboard.tsx @@ -3,13 +3,16 @@ import WebView, { WebViewMessageEvent } from "react-native-webview"; import { ROUTES } from "@/constants/routes"; import { useHandleNavigationActions } from "@/hooks/useHandleNavigationActions"; import { getWebViewApiUrl } from "@/utils/getWebViewApiUrl"; +import { parseMessage } from "@/utils/parseMessage"; export default function DashboardScreen() { const baseUrl = getWebViewApiUrl(); const handleNavigationActions = useHandleNavigationActions(); const requestOnMessage = (e: WebViewMessageEvent) => { - handleNavigationActions(e); + const { type, data } = parseMessage(e); + + handleNavigationActions({ type, data }); }; return ; diff --git a/apps/mobile/app/(route)/meetings.tsx b/apps/mobile/app/(route)/meetings.tsx index 1883a399..d6a442fa 100644 --- a/apps/mobile/app/(route)/meetings.tsx +++ b/apps/mobile/app/(route)/meetings.tsx @@ -3,13 +3,16 @@ import WebView, { WebViewMessageEvent } from "react-native-webview"; import { ROUTES } from "@/constants/routes"; import { useHandleNavigationActions } from "@/hooks/useHandleNavigationActions"; import { getWebViewApiUrl } from "@/utils/getWebViewApiUrl"; +import { parseMessage } from "@/utils/parseMessage"; export default function MeetingsScreen() { const baseUrl = getWebViewApiUrl(); const handleNavigationActions = useHandleNavigationActions(); const requestOnMessage = (e: WebViewMessageEvent) => { - handleNavigationActions(e); + const { type, data } = parseMessage(e); + + handleNavigationActions({ type, data }); }; return ; diff --git a/apps/mobile/app/(route)/seats.tsx b/apps/mobile/app/(route)/seats.tsx index 08c04fb2..f363efc6 100644 --- a/apps/mobile/app/(route)/seats.tsx +++ b/apps/mobile/app/(route)/seats.tsx @@ -3,13 +3,16 @@ import WebView, { WebViewMessageEvent } from "react-native-webview"; import { ROUTES } from "@/constants/routes"; import { useHandleNavigationActions } from "@/hooks/useHandleNavigationActions"; import { getWebViewApiUrl } from "@/utils/getWebViewApiUrl"; +import { parseMessage } from "@/utils/parseMessage"; export default function SeatsScreen() { const baseUrl = getWebViewApiUrl(); const handleNavigationActions = useHandleNavigationActions(); const requestOnMessage = (e: WebViewMessageEvent) => { - handleNavigationActions(e); + const { type, data } = parseMessage(e); + + handleNavigationActions({ type, data }); }; return ; diff --git a/apps/mobile/app/(route)/settings.tsx b/apps/mobile/app/(route)/settings.tsx index 7fe7c530..a368796a 100644 --- a/apps/mobile/app/(route)/settings.tsx +++ b/apps/mobile/app/(route)/settings.tsx @@ -3,13 +3,17 @@ import WebView, { WebViewMessageEvent } from "react-native-webview"; import { ROUTES } from "@/constants/routes"; import { useHandleNavigationActions } from "@/hooks/useHandleNavigationActions"; import { getWebViewApiUrl } from "@/utils/getWebViewApiUrl"; +import { parseMessage } from "@/utils/parseMessage"; export default function SettingsScreen() { const baseUrl = getWebViewApiUrl(); const handleNavigationActions = useHandleNavigationActions(); const requestOnMessage = (e: WebViewMessageEvent) => { - handleNavigationActions(e); + const { type, data } = parseMessage(e); + + handleNavigationActions({ type, data }); }; + return ; } From 92b28040e9031b9bdb6a3d4e0bbc96012f9c9cf3 Mon Sep 17 00:00:00 2001 From: Lin Date: Mon, 27 Jan 2025 20:15:20 +0900 Subject: [PATCH 03/30] =?UTF-8?q?Test:=20=ED=94=84=EB=A6=AC=EB=B7=B0=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 --- apps/web/app/dashboard/_components/DashboardSection.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/app/dashboard/_components/DashboardSection.tsx b/apps/web/app/dashboard/_components/DashboardSection.tsx index d5add773..43c1c08e 100644 --- a/apps/web/app/dashboard/_components/DashboardSection.tsx +++ b/apps/web/app/dashboard/_components/DashboardSection.tsx @@ -33,6 +33,7 @@ export default function DashboardSection({ data = [] }: DashboardSectionProps): return (
+

Preview Test

내 회의


{upcomingMeetings.length > 0 ? ( From aa4c9673a5b77a98e53de9087b41e53e2f4455aa Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 28 Jan 2025 14:30:52 +0900 Subject: [PATCH 04/30] =?UTF-8?q?Feat:=20PR=20=EC=9D=B4=EB=B2=A4=ED=8A=B8?= =?UTF-8?q?=20=ED=83=80=EC=9E=85=20=EC=B6=94=EA=B0=80=EB=A1=9C=20=EB=AF=B8?= =?UTF-8?q?=EB=A6=AC=EB=B3=B4=EA=B8=B0=20URL=20=EA=B0=B1=EC=8B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 60053766..344f04c3 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -7,6 +7,7 @@ permissions: on: pull_request: branches: [develop] + types: [opened, synchronize, reopened] jobs: preview: From f4ea8be6f13b95d7507eee7d6d3835acb480a85f Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 28 Jan 2025 16:09:53 +0900 Subject: [PATCH 05/30] =?UTF-8?q?Fix:=20=ED=94=84=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EB=B9=8C=EB=93=9C=20=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 2 ++ apps/web/next.config.mjs | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 344f04c3..92e539ed 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -38,6 +38,8 @@ jobs: - name: Build run: pnpm -filter=web build + env: + NEXT_PUBLIC_BASE_PATH: /pr-${{ github.event.pull_request.number }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 32a2d8c3..dcaf685a 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -2,6 +2,7 @@ const nextConfig = { reactStrictMode: true, output: "export", + basePath: process.env.NEXT_PUBLIC_BASE_PATH || "", images: { remotePatterns: [ From b0796aaf4d8bcefbfc956f99c9fbbbaa3637aed9 Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 28 Jan 2025 17:12:18 +0900 Subject: [PATCH 06/30] =?UTF-8?q?Chore:=20next.config.mjs=EC=9D=98=20baseP?= =?UTF-8?q?ath,=20rewrites=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 4 +--- apps/web/next.config.mjs | 12 ------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 92e539ed..c7f50c51 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -38,8 +38,6 @@ jobs: - name: Build run: pnpm -filter=web build - env: - NEXT_PUBLIC_BASE_PATH: /pr-${{ github.event.pull_request.number }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 @@ -63,4 +61,4 @@ jobs: **Branch:** ${{ github.head_ref }} **Commit:** ${{ github.sha }} - Preview URL: https://codeit.click/pr-${{ github.event.pull_request.number }} + Preview URL: https://codeit.click?pr=${{ github.event.pull_request.number }} diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index dcaf685a..1d2ef199 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -2,7 +2,6 @@ const nextConfig = { reactStrictMode: true, output: "export", - basePath: process.env.NEXT_PUBLIC_BASE_PATH || "", images: { remotePatterns: [ @@ -72,17 +71,6 @@ const nextConfig = { }, }, }, - - async rewrites() { - return { - beforeFiles: [ - { - source: "/pr-:number/:path*", - destination: "/:path*", - }, - ], - }; - }, }; export default nextConfig; From 5b10ac45cb58028cdd708756580ccd5dd23e0e5c Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 28 Jan 2025 18:21:36 +0900 Subject: [PATCH 07/30] =?UTF-8?q?Feat:=20=ED=94=84=EB=A6=AC=EB=B7=B0=20url?= =?UTF-8?q?=EA=B3=BC=20=EC=9D=BC=EB=B0=98=20url=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20=EB=9D=BC=EC=9A=B0=ED=8C=85=20=EB=B6=84=EA=B8=B0=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/app/_components/AuthGuard.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/web/app/_components/AuthGuard.tsx b/apps/web/app/_components/AuthGuard.tsx index 778b58f8..6967c7d6 100644 --- a/apps/web/app/_components/AuthGuard.tsx +++ b/apps/web/app/_components/AuthGuard.tsx @@ -24,7 +24,22 @@ export default function AuthGuard(): JSX.Element | null { useEffect(() => { if (isLoggedIn) { - router.replace(PAGE_NAME.DASHBOARD); + const path = window.location.pathname; + const isPrURL = path.includes("pr-"); + + // 일반 URL인 경우 + if (path === "/") { + router.replace(PAGE_NAME.DASHBOARD); + return; + } + + // PR preview URL인 경우 + if (isPrURL) { + const isRootPath = path.endsWith("/") || path.match(/\/pr-\d+$/); + const targetPath = isRootPath ? `${path}/dashboard`.replace(/\/+/g, "/") : path; + + router.replace(targetPath); + } } setIsLoading(false); From 0a83fd644ab94184990f398e8f2b583fa0c6c42f Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 28 Jan 2025 18:24:15 +0900 Subject: [PATCH 08/30] =?UTF-8?q?Refactor:=20RegExp=20match=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=EB=A5=BC=20exec=EB=A1=9C=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 --- apps/web/app/_components/AuthGuard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/app/_components/AuthGuard.tsx b/apps/web/app/_components/AuthGuard.tsx index 6967c7d6..9b417ba9 100644 --- a/apps/web/app/_components/AuthGuard.tsx +++ b/apps/web/app/_components/AuthGuard.tsx @@ -35,7 +35,7 @@ export default function AuthGuard(): JSX.Element | null { // PR preview URL인 경우 if (isPrURL) { - const isRootPath = path.endsWith("/") || path.match(/\/pr-\d+$/); + const isRootPath = path.endsWith("/") || /\/pr-\d+$/.exec(path); const targetPath = isRootPath ? `${path}/dashboard`.replace(/\/+/g, "/") : path; router.replace(targetPath); From f439c7374449ef256cbbc49f080e259d9f363ccd Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 28 Jan 2025 22:55:13 +0900 Subject: [PATCH 09/30] =?UTF-8?q?Feat:=20GNB=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EC=9D=B4=EB=8F=99=20=EC=8B=9C=20PR=20=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=9C=A0=EC=A7=80=EB=90=98=EB=8F=84=EB=A1=9D=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 --- apps/web/components/Gnb/GnbMenu.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/web/components/Gnb/GnbMenu.tsx b/apps/web/components/Gnb/GnbMenu.tsx index 433d94bc..c207e8ba 100644 --- a/apps/web/components/Gnb/GnbMenu.tsx +++ b/apps/web/components/Gnb/GnbMenu.tsx @@ -32,9 +32,15 @@ export default function GnbMenu({ isAdmin }: GnbMenuProps): JSX.Element | null { const pathname = usePathname(); const { push } = useAppRouter(); const { isWebView } = useDetectWebView(); + const urlParams = new URLSearchParams(window.location.search); + const prNumber = urlParams.get("pr"); + + const getUrlWithPR = (path: string): string => { + return prNumber ? `${path}?pr=${prNumber}` : path; + }; const handleButtonClick = (path: string): void => { - push(path); + push(getUrlWithPR(path)); }; return ( @@ -57,7 +63,7 @@ export default function GnbMenu({ isAdmin }: GnbMenuProps): JSX.Element | null { }, } : { - href, + href: getUrlWithPR(href), })} className={cn("h-full justify-start md:h-40 md:w-full md:px-0 md:py-0", index === 3 && "block md:hidden")} variant="Text" @@ -82,7 +88,7 @@ export default function GnbMenu({ isAdmin }: GnbMenuProps): JSX.Element | null { {ADMIN_ITEMS.map(({ href, name, icon: Icon }) => { const isActive = pathname === href; return ( - +
Date: Tue, 28 Jan 2025 22:55:55 +0900 Subject: [PATCH 10/30] =?UTF-8?q?Feat:=20PR=20=ED=94=84=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=20URL=20=ED=98=95=EC=8B=9D=EC=9D=84=20=EC=BF=BC=EB=A6=AC=20?= =?UTF-8?q?=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EB=B0=A9=EC=8B=9D?= =?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 --- apps/web/app/_components/AuthGuard.tsx | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/web/app/_components/AuthGuard.tsx b/apps/web/app/_components/AuthGuard.tsx index 9b417ba9..304f155c 100644 --- a/apps/web/app/_components/AuthGuard.tsx +++ b/apps/web/app/_components/AuthGuard.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react"; import { PAGE_NAME } from "@ui/src/utils/constants/pageNames"; -import { useRouter } from "next/navigation"; +import { useRouter, usePathname } from "next/navigation"; import { useAuthStore } from "@/app/store/useAuthStore"; import { createWebViewEventListener } from "../../lib/bridge/createWebViewEventListener"; import { parseWebViewAuthMessage } from "../../lib/bridge/parseWebViewAuthMessage"; @@ -11,10 +11,10 @@ import SignInForm from "./SignInForm"; export default function AuthGuard(): JSX.Element | null { const router = useRouter(); + const pathname = usePathname(); const [isLoading, setIsLoading] = useState(true); const { isLoggedIn } = useAuthStore(); const { isIOSWebView, isAndroidWebView } = useDetectWebView(); - const webViewEventListener = createWebViewEventListener({ isIOSWebView, isAndroidWebView }); useEffect(() => { @@ -23,27 +23,27 @@ export default function AuthGuard(): JSX.Element | null { }, []); useEffect(() => { - if (isLoggedIn) { - const path = window.location.pathname; - const isPrURL = path.includes("pr-"); + if (!isLoggedIn) { + setIsLoading(false); + return; + } + + const urlParams = new URLSearchParams(window.location.search); + const prNumber = urlParams.get("pr"); - // 일반 URL인 경우 - if (path === "/") { - router.replace(PAGE_NAME.DASHBOARD); + const handleRootPath = (): void => { + if (prNumber) { + router.replace(`/dashboard?pr=${prNumber}`); return; } + router.replace(PAGE_NAME.DASHBOARD); + }; - // PR preview URL인 경우 - if (isPrURL) { - const isRootPath = path.endsWith("/") || /\/pr-\d+$/.exec(path); - const targetPath = isRootPath ? `${path}/dashboard`.replace(/\/+/g, "/") : path; - - router.replace(targetPath); - } + if (pathname === "/") { + handleRootPath(); } - setIsLoading(false); - }, [isLoggedIn, router]); + }, [isLoggedIn, router, pathname]); if (isLoading) return null; From d435300a367f14bad9565ae7943bea6d580e2e0c Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 28 Jan 2025 23:06:36 +0900 Subject: [PATCH 11/30] =?UTF-8?q?Fix:=20=EB=B9=8C=EB=93=9C=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/app/_components/AuthGuard.tsx | 16 ++++++---------- apps/web/components/Gnb/GnbMenu.tsx | 12 ++++++++++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/apps/web/app/_components/AuthGuard.tsx b/apps/web/app/_components/AuthGuard.tsx index 304f155c..4c579830 100644 --- a/apps/web/app/_components/AuthGuard.tsx +++ b/apps/web/app/_components/AuthGuard.tsx @@ -28,24 +28,20 @@ export default function AuthGuard(): JSX.Element | null { return; } - const urlParams = new URLSearchParams(window.location.search); - const prNumber = urlParams.get("pr"); + if (pathname === "/" && typeof window !== "undefined") { + const urlParams = new URLSearchParams(window.location.search); + const prNumber = urlParams.get("pr"); - const handleRootPath = (): void => { if (prNumber) { router.replace(`/dashboard?pr=${prNumber}`); - return; + } else { + router.replace(PAGE_NAME.DASHBOARD); } - router.replace(PAGE_NAME.DASHBOARD); - }; - - if (pathname === "/") { - handleRootPath(); } + setIsLoading(false); }, [isLoggedIn, router, pathname]); if (isLoading) return null; - return isLoggedIn ? null : ; } diff --git a/apps/web/components/Gnb/GnbMenu.tsx b/apps/web/components/Gnb/GnbMenu.tsx index c207e8ba..58c74b79 100644 --- a/apps/web/components/Gnb/GnbMenu.tsx +++ b/apps/web/components/Gnb/GnbMenu.tsx @@ -32,10 +32,18 @@ export default function GnbMenu({ isAdmin }: GnbMenuProps): JSX.Element | null { const pathname = usePathname(); const { push } = useAppRouter(); const { isWebView } = useDetectWebView(); - const urlParams = new URLSearchParams(window.location.search); - const prNumber = urlParams.get("pr"); + + const getPrNumber = (): string | null => { + if (typeof window === "undefined") return null; + + const urlParams = new URLSearchParams(window.location.search); + + return urlParams.get("pr"); + }; const getUrlWithPR = (path: string): string => { + const prNumber = getPrNumber(); + return prNumber ? `${path}?pr=${prNumber}` : path; }; From d45510ea8ce495519283ecbc2ea0db303a93c586 Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 28 Jan 2025 23:51:33 +0900 Subject: [PATCH 12/30] =?UTF-8?q?Feat:=20PR=20=ED=94=84=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=20=EB=B9=8C=EB=93=9C=EC=97=90=20assetPrefix=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 3 +++ apps/web/next.config.mjs | 6 ++++++ turbo.json | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index c7f50c51..3523cb3c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -38,6 +38,9 @@ jobs: - name: Build run: pnpm -filter=web build + env: + GITHUB_EVENT_NAME: ${{ github.event_name }} + GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 1d2ef199..ebd92801 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,7 +1,13 @@ +const isPR = process.env.GITHUB_EVENT_NAME === "pull_request"; +const prNumber = process.env.GITHUB_EVENT_NUMBER; + /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, output: "export", + ...(isPR && { + assetPrefix: `/pr-${prNumber}`, + }), images: { remotePatterns: [ diff --git a/turbo.json b/turbo.json index 0bfaaa9d..2ee5bcef 100644 --- a/turbo.json +++ b/turbo.json @@ -16,7 +16,9 @@ "NEXT_PUBLIC_IOS_API_URL", "EXPO_PUBLIC_API_URL_ANDROID", "EXPO_PUBLIC_API_URL_IOS", - "NODE_ENV" + "NODE_ENV", + "GITHUB_EVENT_NAME", + "GITHUB_EVENT_NUMBER" ], "tasks": { "build": { From 43ad17157a2aab67316c3442b412c28bc240e394 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 00:16:49 +0900 Subject: [PATCH 13/30] =?UTF-8?q?Test:=20=EB=B9=8C=EB=93=9C=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 3523cb3c..d6c1a220 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -42,6 +42,11 @@ jobs: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} + - name: Check build output + run: | + echo "Build directory contents:" + ls -la ${{ secrets.BUILD_DIRECTORY }} + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -50,7 +55,11 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} - name: Deploy to S3 with PR-specific prefix - run: aws s3 sync ./${{ secrets.BUILD_DIRECTORY }} s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --delete + run: | + echo "Syncing files to S3..." + aws s3 sync ${{ secrets.BUILD_DIRECTORY }} s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --delete + echo "Files uploaded to S3:" + aws s3 ls s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --recursive - name: CloudFront Invalidate Cache run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/pr-${{ github.event.pull_request.number }}/*" From 6e318b4e636b4d27d3f426812356de49fba7dc9c Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 00:24:32 +0900 Subject: [PATCH 14/30] =?UTF-8?q?Test:=20=EB=B9=8C=EB=93=9C=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index d6c1a220..61645e28 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -37,7 +37,11 @@ jobs: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} - name: Build - run: pnpm -filter=web build + run: | + echo "Current branch: ${{ github.head_ref }}" + echo "PR number: ${{ github.event.pull_request.number }}" + echo "Event name: ${{ github.event_name }}" + pnpm -filter=web build env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} From 6e350e428cf3b28b6745c7e4b1dc3a56271e3b64 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 11:45:31 +0900 Subject: [PATCH 15/30] =?UTF-8?q?Test:=20=EB=B9=8C=EB=93=9C=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 61645e28..e7266f37 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -36,6 +36,11 @@ jobs: env: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} + - name: Check AuthGuard content + run: | + echo "AuthGuard content:" + cat apps/web/app/components/auth/AuthGuard.tsx + - name: Build run: | echo "Current branch: ${{ github.head_ref }}" @@ -48,8 +53,8 @@ jobs: - name: Check build output run: | - echo "Build directory contents:" - ls -la ${{ secrets.BUILD_DIRECTORY }} + echo "Checking index.html content:" + cat out/index.html - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 From 6d2e1fbe5f8a4fd8cace199dd842f07b200239af Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 11:57:03 +0900 Subject: [PATCH 16/30] =?UTF-8?q?Test:=20AuthGuard=20=ED=99=95=EC=9D=B8=20?= =?UTF-8?q?=EA=B3=BC=EC=A0=95=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index e7266f37..9370b631 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -36,11 +36,6 @@ jobs: env: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} - - name: Check AuthGuard content - run: | - echo "AuthGuard content:" - cat apps/web/app/components/auth/AuthGuard.tsx - - name: Build run: | echo "Current branch: ${{ github.head_ref }}" From d73435daf93ea578e53e7ee59d16839ab917ac64 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 12:00:26 +0900 Subject: [PATCH 17/30] =?UTF-8?q?Test:=20out=20=EA=B2=BD=EB=A1=9C=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 9370b631..558f76f0 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -49,7 +49,7 @@ jobs: - name: Check build output run: | echo "Checking index.html content:" - cat out/index.html + cat ${{ secrets.BUILD_DIRECTORY }}/index.html - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 From b2ba199ccc996d8f780e3b6b416b645025cbf641 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 12:05:49 +0900 Subject: [PATCH 18/30] =?UTF-8?q?Test:=20PR=EC=9D=98=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EC=82=AC=ED=95=AD=EC=9D=B4=20=EC=A0=9C=EB=8C=80=EB=A1=9C=20?= =?UTF-8?q?=EC=B2=B4=ED=81=AC=EC=95=84=EC=9B=83=EB=90=98=EC=97=88=EB=8A=94?= =?UTF-8?q?=EC=A7=80=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 558f76f0..943502c3 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -16,6 +16,14 @@ jobs: - name: Git Checkout uses: actions/checkout@v4 + - name: Check git status + run: | + echo "Current branch and commit:" + git branch + git rev-parse HEAD + echo "Last commit message:" + git log -1 --pretty=%B + - name: Install pnpm uses: pnpm/action-setup@v4 with: From c83775936be7bf74a2f1793efa144b32df361978 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 12:51:49 +0900 Subject: [PATCH 19/30] =?UTF-8?q?Test:=20=EB=B3=80=EA=B2=BD=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 943502c3..43e806a5 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -24,6 +24,16 @@ jobs: echo "Last commit message:" git log -1 --pretty=%B + - name: Check PR changes + run: | + echo "DashboardSection content:" + cat apps/web/app/dashboard/_components/DashboardSection.tsx + + - name: Check AuthGuard content + run: | + echo "Looking for AuthGuard.tsx:" + find . -name "AuthGuard.tsx" + - name: Install pnpm uses: pnpm/action-setup@v4 with: @@ -44,12 +54,12 @@ jobs: env: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} - - name: Build + - name: Build with verbose logging run: | echo "Current branch: ${{ github.head_ref }}" echo "PR number: ${{ github.event.pull_request.number }}" echo "Event name: ${{ github.event_name }}" - pnpm -filter=web build + pnpm -filter=web build --verbose env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} From c2efbccf93065593825e9b40911b9bf2cf91ba3f Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 12:55:00 +0900 Subject: [PATCH 20/30] =?UTF-8?q?Test:=20=EB=B9=8C=EB=93=9C=20=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=EB=AC=BC=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 43e806a5..56525b37 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -54,12 +54,17 @@ jobs: env: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} - - name: Build with verbose logging + - name: Build run: | echo "Current branch: ${{ github.head_ref }}" echo "PR number: ${{ github.event.pull_request.number }}" echo "Event name: ${{ github.event_name }}" - pnpm -filter=web build --verbose + # 빌드 결과물 확인 + pnpm -filter=web build + echo "Build output files:" + ls -la ${{ secrets.BUILD_DIRECTORY }} + echo "Checking dashboard page content:" + cat ${{ secrets.BUILD_DIRECTORY }}/dashboard.html env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} From e66b2166f5cc921cc6ee561342946b7b7a4adba1 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 12:59:16 +0900 Subject: [PATCH 21/30] =?UTF-8?q?Test:=20=EC=83=9D=EC=84=B1=EB=90=9C=20chu?= =?UTF-8?q?ck=20=ED=8C=8C=EC=9D=BC=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 56525b37..62f14711 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -54,17 +54,14 @@ jobs: env: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} - - name: Build + - name: Build widh debug run: | echo "Current branch: ${{ github.head_ref }}" echo "PR number: ${{ github.event.pull_request.number }}" echo "Event name: ${{ github.event_name }}" - # 빌드 결과물 확인 pnpm -filter=web build - echo "Build output files:" - ls -la ${{ secrets.BUILD_DIRECTORY }} - echo "Checking dashboard page content:" - cat ${{ secrets.BUILD_DIRECTORY }}/dashboard.html + echo "Checking chunk contents:" + ls -la ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/ env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} From ff0c850932bd2df451409e09e55fee34dbf7ecf4 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 13:04:26 +0900 Subject: [PATCH 22/30] =?UTF-8?q?Test:=20=20app=20=EB=94=94=EB=A0=89?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=EC=9D=98=20chunk=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EB=93=A4=EA=B3=BC=20dashboard=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EC=9D=98=20chunk=20=EB=82=B4=EC=9A=A9=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 62f14711..b829c30d 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -54,14 +54,16 @@ jobs: env: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} - - name: Build widh debug + - name: Build with debug run: | echo "Current branch: ${{ github.head_ref }}" echo "PR number: ${{ github.event.pull_request.number }}" echo "Event name: ${{ github.event_name }}" pnpm -filter=web build - echo "Checking chunk contents:" - ls -la ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/ + echo "Checking app chunks:" + ls -la ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/ + echo "Checking dashboard chunk content:" + cat ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/dashboard/page-*.js env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} From 72c08c67929e8eb4d740f451a365870e6c0316df Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 13:08:31 +0900 Subject: [PATCH 23/30] =?UTF-8?q?Test:=20dashboard=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index b829c30d..e4599688 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -60,10 +60,10 @@ jobs: echo "PR number: ${{ github.event.pull_request.number }}" echo "Event name: ${{ github.event_name }}" pnpm -filter=web build - echo "Checking app chunks:" - ls -la ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/ - echo "Checking dashboard chunk content:" - cat ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/dashboard/page-*.js + echo "Checking dashboard directory contents:" + ls -la ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/dashboard/ + echo "Checking all dashboard related files:" + find ${{ secrets.BUILD_DIRECTORY }} -name "*dashboard*" env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} From bfec3f38b668b81641c7ba99d4b3a203b8d4da9b Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 13:11:46 +0900 Subject: [PATCH 24/30] =?UTF-8?q?Test:=20DashboardSection=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EB=82=B4=EC=9A=A9=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index e4599688..64bb951c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -62,8 +62,8 @@ jobs: pnpm -filter=web build echo "Checking dashboard directory contents:" ls -la ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/dashboard/ - echo "Checking all dashboard related files:" - find ${{ secrets.BUILD_DIRECTORY }} -name "*dashboard*" + echo "Checking dashboard page chunk content:" + cat ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/dashboard/page-1f3a077437d59918.js env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} From c75f041e12c7bce3bb7bdc20cfe268535f543edb Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 13:19:24 +0900 Subject: [PATCH 25/30] =?UTF-8?q?Test:=20Next.js=20=EC=BA=90=EC=8B=9C=20?= =?UTF-8?q?=EC=A7=80=EC=9A=B0=EA=B3=A0=20=EB=B9=8C=EB=93=9C=20=EC=8B=9C?= =?UTF-8?q?=EB=8F=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 64bb951c..4f3aa6ca 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -16,23 +16,12 @@ jobs: - name: Git Checkout uses: actions/checkout@v4 - - name: Check git status + - name: Check DashboardSection content and location run: | - echo "Current branch and commit:" - git branch - git rev-parse HEAD - echo "Last commit message:" - git log -1 --pretty=%B - - - name: Check PR changes - run: | - echo "DashboardSection content:" - cat apps/web/app/dashboard/_components/DashboardSection.tsx - - - name: Check AuthGuard content - run: | - echo "Looking for AuthGuard.tsx:" - find . -name "AuthGuard.tsx" + echo "Finding DashboardSection file:" + find . -name "DashboardSection.tsx" + echo "Git status:" + git status - name: Install pnpm uses: pnpm/action-setup@v4 @@ -54,16 +43,13 @@ jobs: env: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} - - name: Build with debug + - name: Clean build and rebuild run: | - echo "Current branch: ${{ github.head_ref }}" - echo "PR number: ${{ github.event.pull_request.number }}" - echo "Event name: ${{ github.event_name }}" + echo "Cleaning Next.js cache..." + rm -rf apps/web/.next + rm -rf apps/web/out + echo "Building again..." pnpm -filter=web build - echo "Checking dashboard directory contents:" - ls -la ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/dashboard/ - echo "Checking dashboard page chunk content:" - cat ${{ secrets.BUILD_DIRECTORY }}/_next/static/chunks/app/dashboard/page-1f3a077437d59918.js env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} From 32924bdebb7a8bca8d8f6c99d992b07e93961075 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 13:24:08 +0900 Subject: [PATCH 26/30] =?UTF-8?q?Test:=20PR=20=EC=BD=94=EB=93=9C=EA=B0=80?= =?UTF-8?q?=20workflow=EC=97=90=EC=84=9C=20=EC=82=AC=EC=9A=A9=EB=90=98?= =?UTF-8?q?=EB=8A=94=EC=A7=80=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 4f3aa6ca..bca47e0c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -16,13 +16,20 @@ jobs: - name: Git Checkout uses: actions/checkout@v4 - - name: Check DashboardSection content and location + - name: Check DashboardSection changes run: | - echo "Finding DashboardSection file:" - find . -name "DashboardSection.tsx" - echo "Git status:" + echo "Git branch info:" + git branch -v + echo "Recent commits:" + git log -3 --oneline + echo "Working directory status:" git status + - name: Check file content + run: | + echo "DashboardSection.tsx location and content:" + find . -name "DashboardSection.tsx" -exec sh -c 'echo "Location: {}"; cat "{}"' \; + - name: Install pnpm uses: pnpm/action-setup@v4 with: From f59e72d4bc86e8b100aa0f41a35d8a3f5653eae1 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 13:27:37 +0900 Subject: [PATCH 27/30] =?UTF-8?q?Test:=20next.config.mjs=20=ED=99=95?= =?UTF-8?q?=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index bca47e0c..70fac0ec 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -30,6 +30,11 @@ jobs: echo "DashboardSection.tsx location and content:" find . -name "DashboardSection.tsx" -exec sh -c 'echo "Location: {}"; cat "{}"' \; + - name: Check Next.js config + run: | + echo "Next.js config content:" + cat next.config.mjs + - name: Install pnpm uses: pnpm/action-setup@v4 with: From b6cf74337c2fd5749928ed42512aca89ca370c88 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 13:28:49 +0900 Subject: [PATCH 28/30] =?UTF-8?q?Test:=20=EA=B2=BD=EB=A1=9C=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 --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 70fac0ec..9ebd34ef 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -33,7 +33,7 @@ jobs: - name: Check Next.js config run: | echo "Next.js config content:" - cat next.config.mjs + cat apps/web/next.config.mjs - name: Install pnpm uses: pnpm/action-setup@v4 From 6b70eedbc96a4f18c312d0142b20af0ff9d60f29 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 29 Jan 2025 14:20:06 +0900 Subject: [PATCH 29/30] =?UTF-8?q?Test:=20GITHUB=5FEVENT=5FNAME=EA=B3=BC=20?= =?UTF-8?q?GITHUB=5FEVENT=5FNUMBER=EB=A5=BC=20.env.production.local=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 38 ++++------------------------------- apps/web/next.config.mjs | 5 ++--- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 9ebd34ef..6e3e69ca 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -16,25 +16,6 @@ jobs: - name: Git Checkout uses: actions/checkout@v4 - - name: Check DashboardSection changes - run: | - echo "Git branch info:" - git branch -v - echo "Recent commits:" - git log -3 --oneline - echo "Working directory status:" - git status - - - name: Check file content - run: | - echo "DashboardSection.tsx location and content:" - find . -name "DashboardSection.tsx" -exec sh -c 'echo "Location: {}"; cat "{}"' \; - - - name: Check Next.js config - run: | - echo "Next.js config content:" - cat apps/web/next.config.mjs - - name: Install pnpm uses: pnpm/action-setup@v4 with: @@ -55,22 +36,15 @@ jobs: env: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} - - name: Clean build and rebuild + - name: Build run: | - echo "Cleaning Next.js cache..." - rm -rf apps/web/.next - rm -rf apps/web/out - echo "Building again..." + echo "GITHUB_EVENT_NAME=${{ github.event_name }}" >> apps/web/.env.production.local + echo "GITHUB_EVENT_NUMBER=${{ github.event.pull_request.number }}" >> apps/web/.env.production.local pnpm -filter=web build env: GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_EVENT_NUMBER: ${{ github.event.pull_request.number }} - - name: Check build output - run: | - echo "Checking index.html content:" - cat ${{ secrets.BUILD_DIRECTORY }}/index.html - - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -79,11 +53,7 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} - name: Deploy to S3 with PR-specific prefix - run: | - echo "Syncing files to S3..." - aws s3 sync ${{ secrets.BUILD_DIRECTORY }} s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --delete - echo "Files uploaded to S3:" - aws s3 ls s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --recursive + run: aws s3 sync ./${{ secrets.BUILD_DIRECTORY }} s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --delete - name: CloudFront Invalidate Cache run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/pr-${{ github.event.pull_request.number }}/*" diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index ebd92801..0f285cf2 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,13 +1,12 @@ const isPR = process.env.GITHUB_EVENT_NAME === "pull_request"; const prNumber = process.env.GITHUB_EVENT_NUMBER; +const assetPrefix = isPR ? `/pr-${prNumber}` : ""; /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, output: "export", - ...(isPR && { - assetPrefix: `/pr-${prNumber}`, - }), + assetPrefix, images: { remotePatterns: [ From 6d428e04440822c484d947d688e3c64e8beb4d85 Mon Sep 17 00:00:00 2001 From: Lin Date: Thu, 30 Jan 2025 14:26:21 +0900 Subject: [PATCH 30/30] =?UTF-8?q?Feat:=20actions/checkout@v4=20=EC=95=A1?= =?UTF-8?q?=EC=85=98=EC=97=90=20ref=20=EC=98=B5=EC=85=98=EC=9D=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=ED=95=98=EC=97=AC=20PR=20=EB=B8=8C=EB=9E=9C?= =?UTF-8?q?=EC=B9=98=EC=9D=98=20=EC=BD=94=EB=93=9C=EB=A5=BC=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=EC=95=84=EC=9B=83=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 6e3e69ca..4a8d28ac 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -15,6 +15,9 @@ jobs: steps: - name: Git Checkout uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@v4