Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
Comment thread
kimminna marked this conversation as resolved.
Resolved

- uses: pnpm/action-setup@v4

Expand All @@ -67,5 +69,15 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check affected packages
id: affected
run: |
set +e
pnpm turbo query affected --base origin/${{ github.base_ref }} --head HEAD --exit-code
Comment thread
kimminna marked this conversation as resolved.
Resolved
CODE=$?
set -e
echo "has_changes=$([ $CODE -eq 1 ] && echo true || echo false)" >> $GITHUB_OUTPUT

- name: Build
if: steps.affected.outputs.has_changes == 'true'
run: pnpm build
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dev:web": "turbo run dev --filter=timo-web",
"storybook": "pnpm --filter @repo/timo-design-system storybook",
"build-storybook": "pnpm --filter @repo/timo-design-system build-storybook",
"build:storybook": "turbo run build:storybook",
"chromatic": "pnpm --filter @repo/timo-design-system chromatic",
"lint": "turbo run lint",
"lint:web": "turbo run lint --filter=timo-web",
Expand Down
1 change: 1 addition & 0 deletions packages/timo-design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"check-types": "tsc --noEmit",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"build:storybook": "storybook build",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

두 스크립트가 동일한 명령을 수행하고 있는데 차이가 뭔지 궁금해요~

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build:storybook은 터보레포 컨벤션에 맞게 추가한 컨벤션으로, 수정하면서 중복이 생겼네요~~~ 제거할게요!

"chromatic": "chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --only-changed --exit-zero-on-changes"
},
"devDependencies": {
Expand Down
10 changes: 9 additions & 1 deletion turbo.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turbo.json에서 ! 붙이면 특정 파일을 빌드 캐시 계산에서 제외할 수 있는지 처음 알았어요!!
이런 식으로 캐시를 조정할 수 있는 거 신기하네요 👀👍

Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,26 @@
],
"tasks": {
"build": {
"description": "Next.js 앱 빌드 및 패키지 컴파일",
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"inputs": ["$TURBO_DEFAULT$", ".env*", "!**/*.stories.{tsx,mdx}"],
Comment thread
kimminna marked this conversation as resolved.
Resolved
"outputs": [".next/**", "!.next/cache/**", "!.next/dev/**"],
"passThroughEnv": ["SENTRY_AUTH_TOKEN"]
},
"build:storybook": {
"description": "Storybook 정적 파일 빌드",
"outputs": ["storybook-static/**"]
},
"lint": {
"description": "ESLint로 코드 스타일 및 오류 검사",
"dependsOn": ["^lint"]
},
"check-types": {
"description": "TypeScript 타입 검사",
"dependsOn": ["^check-types"]
},
"dev": {
"description": "개발 서버 실행",
"cache": false,
"persistent": true
}
Expand Down
Loading