1111jobs :
1212 setup-backend :
1313 runs-on : ubuntu-latest
14+ outputs :
15+ cache-key : ${{ steps.cache-backend-deps.outputs.cache-hit }}
1416 steps :
1517 - name : Checkout repository
16- uses : actions/checkout@v2
18+ uses : actions/checkout@v3
1719
1820 - name : Set up Node.js
19- uses : actions/setup-node@v2
21+ uses : actions/setup-node@v3
2022 with :
2123 node-version : " 23"
2224
2325 # 백엔드 의존성 캐시 설정
2426 - name : Cache Yarn dependencies for backend
25- uses : actions/cache@v2
27+ id : cache-backend-deps
28+ uses : actions/cache@v3
2629 with :
2730 path : backend/node_modules
28- key : ${{ runner.os }}-backend-yarn-${{ hashFiles('**/backend/yarn.lock') }}
29- restore-keys : |
30- ${{ runner.os }}-backend-yarn-
31+ key : ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }}
3132
3233 # 백엔드 의존성 설치
3334 - name : Install backend dependencies
35+ if : steps.cache-backend-deps.outputs.cache-hit != 'true'
3436 working-directory : ./backend
3537 run : yarn install
3638
37- # 백엔드 의존성 아티팩트 업로드
38- - name : Save backend node_modules as artifact
39- uses : actions/upload-artifact@v3 # Updated to v3
40- with :
41- name : backend_node_modules
42- path : backend/node_modules
43-
4439 setup-frontend :
4540 runs-on : ubuntu-latest
41+ outputs :
42+ cache-key : ${{ steps.cache-frontend-deps.outputs.cache-hit }}
4643 steps :
4744 - name : Checkout repository
48- uses : actions/checkout@v2
45+ uses : actions/checkout@v3
4946
5047 - name : Set up Node.js
51- uses : actions/setup-node@v2
48+ uses : actions/setup-node@v3
5249 with :
5350 node-version : " 23"
5451
5552 # 프론트엔드 의존성 캐시 설정
5653 - name : Cache Yarn dependencies for frontend
57- uses : actions/cache@v2
54+ id : cache-frontend-deps
55+ uses : actions/cache@v3
5856 with :
5957 path : frontend/node_modules
60- key : ${{ runner.os }}-frontend-yarn-${{ hashFiles('**/frontend/yarn.lock') }}
61- restore-keys : |
62- ${{ runner.os }}-frontend-yarn-
58+ key : ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }}
6359
6460 # 프론트엔드 의존성 설치
6561 - name : Install frontend dependencies
62+ if : steps.cache-frontend-deps.outputs.cache-hit != 'true'
6663 working-directory : ./frontend
6764 run : yarn install
6865
69- # 프론트엔드 의존성 아티팩트 업로드
70- - name : Save frontend node_modules as artifact
71- uses : actions/upload-artifact@v3 # Updated to v3
72- with :
73- name : frontend_node_modules
74- path : frontend/node_modules
75-
7666 backend-lint :
7767 runs-on : ubuntu-latest
7868 needs : setup-backend
7969 steps :
8070 - name : Checkout repository
81- uses : actions/checkout@v2
71+ uses : actions/checkout@v3
8272
83- # 백엔드 의존성 아티팩트 다운로드
84- - name : Restore backend node_modules
85- uses : actions/download-artifact@v3 # Updated to v3
73+ - name : Set up Node.js
74+ uses : actions/setup-node@v3
75+ with :
76+ node-version : " 23"
77+
78+ # 백엔드 의존성 캐시 복원
79+ - name : Restore Yarn dependencies for backend
80+ uses : actions/cache@v3
8681 with :
87- name : backend_node_modules
8882 path : backend/node_modules
83+ key : ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }}
8984
9085 # 백엔드 린트 실행
9186 - name : Run backend lint
@@ -103,14 +98,19 @@ jobs:
10398 needs : setup-frontend
10499 steps :
105100 - name : Checkout repository
106- uses : actions/checkout@v2
101+ uses : actions/checkout@v3
102+
103+ - name : Set up Node.js
104+ uses : actions/setup-node@v3
105+ with :
106+ node-version : " 23"
107107
108- # 프론트엔드 의존성 아티팩트 다운로드
109- - name : Restore frontend node_modules
110- uses : actions/download-artifact@v3 # Updated to v3
108+ # 프론트엔드 의존성 캐시 복원
109+ - name : Restore Yarn dependencies for frontend
110+ uses : actions/cache@ v3
111111 with :
112- name : frontend_node_modules
113112 path : frontend/node_modules
113+ key : ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }}
114114
115115 # 프론트엔드 린트 실행
116116 - name : Run frontend lint
@@ -128,14 +128,19 @@ jobs:
128128 needs : setup-backend
129129 steps :
130130 - name : Checkout repository
131- uses : actions/checkout@v2
131+ uses : actions/checkout@v3
132132
133- # 백엔드 의존성 아티팩트 다운로드
134- - name : Restore backend node_modules
135- uses : actions/download-artifact@v3 # Updated to v3
133+ - name : Set up Node.js
134+ uses : actions/setup-node@v3
135+ with :
136+ node-version : " 23"
137+
138+ # 백엔드 의존성 캐시 복원
139+ - name : Restore Yarn dependencies for backend
140+ uses : actions/cache@v3
136141 with :
137- name : backend_node_modules
138142 path : backend/node_modules
143+ key : ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }}
139144
140145 # 백엔드 빌드 실행
141146 - name : Run backend build
@@ -147,14 +152,19 @@ jobs:
147152 needs : setup-frontend
148153 steps :
149154 - name : Checkout repository
150- uses : actions/checkout@v2
155+ uses : actions/checkout@v3
151156
152- # 프론트엔드 의존성 아티팩트 다운로드
153- - name : Restore frontend node_modules
154- uses : actions/download-artifact@v3 # Updated to v3
157+ - name : Set up Node.js
158+ uses : actions/setup-node@v3
159+ with :
160+ node-version : " 23"
161+
162+ # 프론트엔드 의존성 캐시 복원
163+ - name : Restore Yarn dependencies for frontend
164+ uses : actions/cache@v3
155165 with :
156- name : frontend_node_modules
157166 path : frontend/node_modules
167+ key : ${{ runner.os }}-frontend-yarn-${{ hashFiles('frontend/yarn.lock') }}
158168
159169 # 프론트엔드 빌드 실행
160170 - name : Run frontend build
@@ -166,14 +176,19 @@ jobs:
166176 needs : [setup-backend, backend-build]
167177 steps :
168178 - name : Checkout repository
169- uses : actions/checkout@v2
179+ uses : actions/checkout@v3
180+
181+ - name : Set up Node.js
182+ uses : actions/setup-node@v3
183+ with :
184+ node-version : " 23"
170185
171- # 백엔드 의존성 아티팩트 다운로드
172- - name : Restore backend node_modules
173- uses : actions/download-artifact@v3 # Updated to v3
186+ # 백엔드 의존성 캐시 복원
187+ - name : Restore Yarn dependencies for backend
188+ uses : actions/cache@ v3
174189 with :
175- name : backend_node_modules
176190 path : backend/node_modules
191+ key : ${{ runner.os }}-backend-yarn-${{ hashFiles('backend/yarn.lock') }}
177192
178193 # 백엔드 테스트 실행
179194 - name : Run backend tests
0 commit comments