8181 timeout-minutes : 10
8282 env :
8383 TZ : Asia/Seoul
84+ strategy :
85+ matrix :
86+ package : [web, '@workspace/ui']
87+
8488 steps :
8589 - name : Checkout Code
8690 uses : actions/checkout@v4
@@ -95,32 +99,36 @@ jobs:
9599 with :
96100 node-version : 20
97101 cache : ' pnpm'
98- cache-dependency-path : ' src/frontend/ pnpm-lock.yaml'
102+ cache-dependency-path : ' pnpm-lock.yaml'
99103
100104 - name : Restore pnpm store cache
101105 uses : actions/cache@v4
102106 with :
103107 path : ~/.pnpm-store
104- key : ${{ runner.os }}-pnpm-${{ hashFiles('src/frontend/ pnpm-lock.yaml') }}
108+ key : ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
105109 restore-keys : |
106110 ${{ runner.os }}-pnpm-
107111
108112 - name : Restore Turbo cache
109113 uses : actions/cache@v4
110114 with :
111- path : src/frontend/ .turbo
112- key : ${{ runner.os }}-turbo-${{ hashFiles('src/frontend/ pnpm-lock.yaml') }}
115+ path : .turbo
116+ key : ${{ runner.os }}-turbo-${{ hashFiles('pnpm-lock.yaml') }}
113117 restore-keys : |
114118 ${{ runner.os }}-turbo-
115119
116- - name : Install Dependencies (if necessary)
117- working-directory : src/frontend
118- run : |
119- if [ ! -d "node_modules" ]; then
120- pnpm install --frozen-lockfile --prefer-offline
121- fi
120+ - name : Restore Next.js cache (for web)
121+ if : matrix.package == 'web'
122+ uses : actions/cache@v4
123+ with :
124+ path : apps/web/.next/cache
125+ key : ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}
126+ restore-keys : |
127+ ${{ runner.os }}-nextjs-
128+
129+ - name : Install Dependencies
130+ run : pnpm install --frozen-lockfile --prefer-offline
122131
123132 - name : Run Build with Cache
124- working-directory : src/frontend
125133 run : |
126- pnpm exec turbo build --filter=web --filter=@workspace/ui --parallel
134+ pnpm exec turbo build --filter=${{ matrix.package }} --parallel
0 commit comments