diff --git a/.github/workflows/frontend-prod-cd.yml b/.github/workflows/frontend-prod-cd.yml index a3326030..b274f01d 100644 --- a/.github/workflows/frontend-prod-cd.yml +++ b/.github/workflows/frontend-prod-cd.yml @@ -17,19 +17,22 @@ jobs: backend: ${{ steps.filter.outputs.backend }} frontend: ${{ steps.filter.outputs.frontend }} steps: - - uses: actions/checkout@v4 # Push 이벤트이기 때문에 checkout 해야 함 + - uses: actions/checkout@v4 with: - ref: main + fetch-depth: 0 # 모든 히스토리를 가져옵니다 + - name: Get previous tag + id: previoustag + run: echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ --always)" >> $GITHUB_OUTPUT - uses: dorny/paths-filter@v3 id: filter with: - base: "main" # 해당 브랜치의 last commit과 변경점 비교 + base: ${{ steps.previoustag.outputs.PREVIOUS_TAG }} + ref: ${{ github.ref }} filters: | backend: - 'backend/**' frontend: - 'frontend/**' - fe-build: needs: detect-changes # jobs들은 병렬로 실행됨, needs 키워드를 사용해서 특정 job이 완료(성공)면 실행하도록 설정 if: ${{ needs.detect-changes.outputs.frontend == 'true' }} diff --git a/frontend/package.json b/frontend/package.json index f1d85990..8bbfa95e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,7 @@ "prod": "webpack server --open --config webpack.prod.js", "dev": "webpack server --open --config webpack.dev.js", "build:prod": "NODE_ENV=production webpack --config webpack.prod.js && npm run sentry:sourcemaps", - "build:dev": "NODE_ENV=development webpack --config webpack.dev.js", + "build:dev": "NODE_ENV=production webpack --config webpack.prod.js", "sentry:sourcemaps": "sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload -o momo2024 -p momo-harry-test /dist", "lint:css": "stylelint '**/*.styles.ts' --fix", "test": "jest", diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 4f5ef871..10d6dd62 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -14,6 +14,7 @@ const enableMocking = async () => { if (process.env.NODE_ENV !== 'development') { return; } + const { worker } = await import('@mocks/browser'); return worker.start();