File tree Expand file tree Collapse file tree 4 files changed +10415
-14384
lines changed Expand file tree Collapse file tree 4 files changed +10415
-14384
lines changed Original file line number Diff line number Diff line change
1
+ name : DMS Webview CI
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' feature/**'
7
+ - ' hotfixes'
8
+ - ' release/**'
9
+ - ' main'
10
+ - ' develop'
11
+ pull_request :
12
+ branches :
13
+ - ' main'
14
+ - ' develop'
15
+ - ' release/**'
16
+
17
+ # 동일한 브랜치/PR에 대한 동시 실행을 방지하고, 최신 커밋에 대한 워크플로우만 실행합니다.
18
+ concurrency :
19
+ group : ${{ github.workflow }}-${{ github.ref }}
20
+ cancel-in-progress : true
21
+
22
+ jobs :
23
+ build :
24
+ name : Build and Verify
25
+ runs-on : ubuntu-latest
26
+ steps :
27
+ - name : Checkout code
28
+ uses : actions/checkout@v3
29
+
30
+ - name : Enable Corepack
31
+ run : corepack enable
32
+
33
+ - name : Set up Node.js v18
34
+ uses : actions/setup-node@v3
35
+ with :
36
+ node-version : 18
37
+ # yarn 캐시를 활성화하여 의존성 설치 속도를 향상시킵니다.
38
+ cache : ' yarn'
39
+
40
+ # .env 파일을 생성하여 빌드 시 환경변수를 주입합니다.
41
+ # axios.ts에서 process.env.REACT_APP_BASE_URL을 사용하므로, 변수 이름을 이에 맞춥니다.
42
+ - name : Create .env file
43
+ env :
44
+ # GitHub Repository Secret에 저장된 DMS_WEBVIEW_DOMAIN 값을 가져옵니다.
45
+ REACT_APP_BASE_URL : ${{ secrets.DMS_WEBVIEW_DOMAIN }}
46
+ run : |
47
+ echo "REACT_APP_BASE_URL=${REACT_APP_BASE_URL}" >> .env
48
+
49
+ - name : Install dependencies
50
+ # --frozen-lockfile 옵션은 yarn.lock 파일을 기준으로 정확한 버전의 패키지를 설치하도록 강제합니다.
51
+ run : yarn install --frozen-lockfile
52
+
53
+ - name : Build project
54
+ # DISABLE_ESLINT_PLUGIN=true는 빌드 시 ESLint 오류를 무시하는 설정입니다.
55
+ # CI 환경에서 빌드 성공 여부만 확인할 때 종종 사용됩니다.
56
+ run : DISABLE_ESLINT_PLUGIN=true yarn build
Original file line number Diff line number Diff line change @@ -6,8 +6,23 @@ import { setCookie } from './utils/cookies';
6
6
7
7
function App ( ) {
8
8
useEffect ( ( ) => {
9
- window . receiveToken = ( token ) => {
10
- setCookie ( 'access_token' , token ) ;
9
+ window . setAuthToken = ( accessToken , refreshToken ) => {
10
+ const expires = new Date ( ) ;
11
+ expires . setDate ( expires . getDate ( ) + 7 ) ;
12
+
13
+ if ( accessToken ) {
14
+ setCookie ( 'access_token' , accessToken , {
15
+ path : '/' ,
16
+ expires,
17
+ } ) ;
18
+ }
19
+ if ( refreshToken ) {
20
+ setCookie ( 'refresh_token' , refreshToken , {
21
+ path : '/' ,
22
+ expires,
23
+ } ) ;
24
+ }
25
+ window . location . reload ( ) ;
11
26
} ;
12
27
} , [ ] ) ;
13
28
return (
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ export {};
2
2
3
3
declare global {
4
4
interface Window {
5
- receiveToken : ( token : string ) => void ;
5
+ setAuthToken : ( accessToken : string , refreshToken : string ) => void ;
6
6
}
7
7
}
You can’t perform that action at this time.
0 commit comments