Skip to content

Commit 96577d8

Browse files
leegwichanPgmJunrbgksqkruseon
authored
Merge pull request #437 from woowacourse-teams/develop
* feat: 클래스 패키지 네이밍 대신 어노테이션을 통해 메서드를 선별하도록 수정 #393 * feat: 라운드 종료 여부 API에서 마스터 정보 제거 #394 * feat: 투표 종료 여부 조회 시, 마스터 정보 제거 #394 * feat: 방 초기화 확인 API에서 마스터 정보 제거 #394 * test: 투표 종료 여부 조회 테스트 수정 * test: RoomContentControllerTest Fixture 적용 #114 * refactor: MemberFixture 임시 네이밍 변경 #114 * refactor: MainPage 훅 디렉토리 수정 #276 * refactor: 잘못된 경로일 경우 홈 버튼 추가 #276 * refactor: NicknamePage 유틸과 훅 디렉토리 분리 #276 * refactor: ReadyPage에서 사용되는 컴포넌트를 페이지 디렉토리 내부로 이동 #276 * refactor: GamePage에서 사용되는 컴포넌트를 페이지 디렉토리 내부로 이동 #276 * refactor: RoundResultPage에서 사용되는 컴포넌트 페이지 디렉토리 내부로 이동 #276 * refactor: GameResultPage에서 사용되는 컴포넌트를 페이지 디렉토리 내부로 이동 #276 * refactor: SelectOption 디렉토리 수정 #276 * refactor: 완전한 공통 컴포넌트 외에는 common에서 components로 이동 #276 * refactor: page 디렉토리에 components 폴더 생성 #276 * test: RoomBalanceVoteControllerTest Fixture 적용 #114 * test: RoomControllerTest Fixture 적용 #114 * test: BalanceContentServiceTest Fixture 적용 #114 * test: RoomContentFacadeTest Fixture 적용 #114 * test: RoomBalanceVoteFacadeTest Fixture 적용 #114 * test: RoomFacadeTest Fixture 적용 #114 * test: RoomContentServiceTest Fixture 적용 #114 * test: RoomBalanceVoteServiceTest Fixture 적용 #114 * test: RoomMigratorTest Fixture 적용 #114 * test: MemberServiceTest Fixture 적용 #114 * test: RoomServiceTest Fixture 적용 #114 * test: RoomFacadeTest Fixture 추가 적용 #114 * test: RoomBalanceVoteFacadeTest Fixture 추가 적용 #114 * refactor: MembersFixture 제거 #114 * refactor: Fixture 객체 생성자 주입 사용 #114 * style: EntityFixtureUtils 위치 최상위 support 패키지로 변경 #114 * style: Fixture 객체 support-fixture-domain 패키지로 이동 #114 * refactor: init-test.sql 제거 #114 * refactor: 중복 코드 메서드화 #114 * refactor: Member Fixture 생성 간편화 메서드 추가 #114 * refactor: roomContents 생성 로직 간소화 #114 * refactor: BalanceOption, BalanceContent 생성 로직 간소화 #114 * refactor: 불필요한 방 생성 인자 제거 #114 * fix: option Fixture 사용 버그 수정 #114 * refactor: MemberFixture 리팩터링 실시 #397 * test: 사용하지 않은 메서드 제거 #397 * refactor: 방 생성 및 방 참여 API 호출에 쓰로틀링을 걸어 중복 호출 방지 #401 * refactor: 방 생성과 방 참여 로직 분리 #401 * refactor: 방 참여 가능 여부 판단 Query 분리 #401 * refactor: 방에 참여할 수 없을 때 에러를 던져 에러 폴백 UI로 처리 #401 * refactor: 투표 API에 쓰로틀링 적용 #401 * refactor: 투표 API 요청이 들어오자마자 선택 완료 상태로 변경 #401 * refactor: useThrottle 타입 강화 #401 * fix: mutation 성공했을 때도 버튼 disabled 상태 처리 #401 * refactor: 방 생성과 방 참여 이벤트 핸들러를 하나로 묶지 않고 isMaster 분기처리를 드러내기 #401 * refactor: 에러 처리 공통 로직 재사용을 위해 커스텀 훅으로 분리 #401 * refactor: 투표할 때 에러가 발생할 경우 롤백 로직 추가 #401 * feat: 타이머 로직을 worker에 위임 #403 * refactor: worker를 타이머에 적용하여 탭 전환시 발생하는 타이머 오차 개선 #403 * refactor: web worker 모킹 추가 #403 * refactor: 메인 스레드와 독립적인 worker thread의 타이머 로직을 테스트 할 수 없어 타이머 테스트 코드 제거 #403 * refactor: 네트워크 에러와 관리되지 않는 에러 분기 처리 추가 #407 * refactor: 에러 상태 코드 상수화 #407 * refactor: 처리되지 않는 에러도 에러 폴백 UI를 보여주고 sentry로 추적 #407 * style: 사용하지 않는 import문 제거 #397 * refactor: url 중복 제거 및 keywords 추가 #409 * refactor: 클래스 이름을 더 구체화하여 변경 #410 - 기존 `VoteContext`는 받아들이기에 추상적이었음 - 이를 투표의 현재 상황을 보여준다는 `VotingStatus`로 바꾸어 클래스 이름을 구체화 함 * refactor: 메서드 순서 및 누락된 어노테이션 추가 #410 * feat: VotingStatus에 API에 필요한 정보 및 메서드 추가 #410 * feat: 변경된 API에 맞추어 DTO 수정 #410 - FacadeTest, ControllerTest, DocumentTest 에 추가 내용 검증 * refactor: 사용하지 않는 생성자 제거 #410 * feat: 변경된 API에 맞추어 전반적인 로직 수정 #410 * refactor: 사용하지 않는 메서드 제거 #410 * style: import 문 재정렬 #410 * refactor: 사용하지 않는 메서드 제거 #410 * refactor: useThrottle any대신 Parameters 타입 적용 #401 * refactor: 불필요한 에러 조건문 제거 #407 * refactor: toast UI 여는 함수명을 명시적으로 showToast로 변경 #407 * refactor: modal UI를 띄우는 함수명을 명시적으로 showModal로 변경 #407 * feat: CD 스크립트 변경 v.01 #415 * fix: 길어진 실행 시간으로 인해 헬스 체크 시간을 증가함 #415 * feat: 변경된 인프라에 맞추어 Replication 코드 비활성화 * feat: fe cd dev script 작성 #414 * feat: fe cd prod script 작성 #414 * refactor: 사용하지 않는 코드 및 설정 제거 * fix: 길어진 실행 시간으로 인해 헬스 체크 시간을 증가함 #415 * feat: 변경된 인프라에 맞추어 Replication 코드 비활성화 * refactor: 사용하지 않는 코드 및 설정 제거 * fix: 길어진 실행 시간으로 인해 헬스 체크 시간을 증가함 v2 #415 * refactor: 사용하지 않는 필드 제거 #410 * style: 테스트 given-when-then 구문 추가 #410 * test: 각 테스트 별 assert 문 추가 * chore: 새 배포환경에 맞게 ci 스크립트 수정 #416 * chore: 새 배포환경에 맞게 cd 스크립트 수정 #416 * refactor: fe cd dev script job 하나로 합치고, 노드 버전 명시 및 artifact 관련 코드 삭제 #414 * refactor: fe cd prod script job 하나로 합치고, 노드 버전 명시 및 artifact 관련 코드 삭제 #414 * refactor: 쉘 스크립트를 환경을 분리하여 관리 #415 * refactor: 각각의 시크릿 키를 사용하여 env 파일을 생성하도록 수정 #414 * chore: script 파일 프로젝트 패키지에서 관리하도록 구성 #416 * chore: 잘못 설정된 스크립트 업로드 코드 제거 #416 * refactor: isJoinableQuery 불필요한 반환값 제거 #401 * refactor: 방 접근 API 요청 쿼리 상태값 isMaster로 분기처리 #401 * refactor: 사용하지 않는 메서드 제거 #410 * style: import 문 추가 및 메서드 순서 변경 #397 * chore: d-n 라벨 자동화 스크립트 작성 #422 * chore: 불필요한 코드 제거 및 github rest 사용 #422 * fix: AsyncErrorFallback Error Type 조건문 명확하게 명시 #407 * refactor: 한국 시간을 기준으로 주말에는 D-n 카운팅 안하도록 설정 #422 * refactor: description & keyword 추가 #409 * feat: 프론트엔드 코드 리뷰 리마인더 스크립트 작성 #424 * refactor: PR마다 마감일 추가 및 approved 상태인 경우 멘션하지 않도록 수정 #424 * feat: 해당 PR에 새로운 수정사항이 있는지 바로 확인할 수 있도록 PR 생성일과 마지막 수정 추가 #424 * feat: 수동 트리거 추가 #424 * fix: OS에 따라 이모지가 스크립트에서 이모지가 깨져 includes로 수정 #422 * fix: 라벨이 안달려 있는 경우 D-2 라벨 설정으로 수정 #422 * refactor: "FE" 라벨이 포함된 PR만 필터링 #422 * refactor: 라벨 이름에 포함되어 있는 이모티콘이 os에 따라 깨질 수 있으므로 FE 글자를 포함하는 코드로 수정 #424 * feat: 스크립트 작동 테스트를 위해 트리거 추가 #424 * style: 불필요한 import 제거 #427 * refactor: github-script를 활용하여 코드 수정 #424 * refactor: 특정 PR의 리뷰 상태를 가져오는 로직 및 디스코드 멘션에 필요한 맵핑 객체 추가 #424 * refactor: 사용하지 않는 node-fetch 모듈 삭제 #424 * refactor: try-catch 문 수정 #424 * feat: 게임 화면에서 투표 인원과 전체 인원을 응답받아 게임 중 투표 현황 보여주기 #427 * fix: 멘션이 되지 않는 문제 해결 #424 * chore: emotion Theme 타입에서 설정한 Theme 상수를 인식하도록 설정 #427 * refactor: 투표 폴링으로 인해 생긴 불필요한 리렌더링을 줄이기 위해 컴포넌트 분리 #427 * refactor: 응답값 도착 여부에 따라 opacity 적용하여 사용자 경험 개선 #427 * fix: 값이 0일때 도 보이도록 nullish 연산자 사용 #427 * refactor: 멘션이 안 되는 문제 해결 및 리뷰의 state가 약자로 보이도록 수정 #424 * fix: 멘션이 안 되는 문제 디스코드 아이디를 매핑하여 해결 #424 * fix: 시크릿키 참조 오류 수정 #424 * fix: 사용자언급과 상태 사이에 간격을 두어 멘션이 안 되는 문제 해결 #424 * feat: api 호출 시 허용된 멘션 항목을 바디에 추가 #424 * refactor: 알림이 오지 않아 allowed_mentions 속성에 들어가는 값 users에서 parse로 수정 #424 * feat: 서버 응답 확인 코드 추가 #424 * refactor: api 요청 시 오타 수정 #424 * refactor: 코드 리마인더 메세지에 대한 피드백 반영 및 승인된 PR에 대한 메세지에서 PR 생성자 멘션 되도록 수정 #424 * refactor: 디데이 중괄호 감싸기 및 마지막 수정 항목 제거 #424 * refactor: 링크가 임베드 되어 메세지가 길어져 임베드 되지 않도록 수정 #424 * refactor: 리뷰어 최신 상태만 출력되도록 수정 및 pr작성자는 리뷰어에서 제외 #424 * fix: 아직 리뷰를 남기지 않은 리뷰어가 있는 경우 승인 완료 안내 오류 해결 #424 * refactor: 라벨 스크립트 시간 이후에 올라온 PR에 바로 D-3이 부여되도록 수정 #432 * refactor: 정각 시간 설정시 과부화로 인해 지연되어 오전 10시 10분으로 수정 #432 * refactor: 테스트를 위해 설정했던 pr트리거 삭제 #432 * refactor: 정각 시간 설정시 과부화로 인해 지연되어 라벨 자동화 스크립트 자동 실행 시간 12시 10분으로 수정 #432 * refactor: 카테고리를 MySQL에서 VARCHAR로 관리하도록 변경 #435 * feat: 카테고리에 개발자 추가 #435 * fix: 의견 수렴하여 개발 카테고리 이름 변경 #435 * fix: 개발 카테고리 enum 이름 변경 #435 * refactor: 모든 리뷰어가 어프루브 상태인지 확인하는 디버깅 코드 추가 #432 * refactor: 디버깅을 위해 스크립트 트리거 임시 추가 #432 * refactor: 모든 리뷰어가 어프루브 상태인지 확인하는 로직 수정 #432 * refactor: 요청된 리뷰어 확인하는 디버깅 코드 추가 #432 * refactor: 디버깅 중 알림 가지 않도록 코드 수정 #432 * fix: 디버깅 중 알림 가지 않도록 코드 수정시 오류 해결 #432 * refactor: JPA 표준에 맞추어 `columnDefinition`으로 설정 #435 * refactor: 요청된 리뷰어를 제대로 불러오는지 확인하는 디버깅 코드 추가 #432 * refactor: pr에서 불러올 수 있는 정보를 확인하는 디버깅 코드 추가 #432 * refactor: requested_reviewers가 빈배열로 나와 FE 리뷰어 고정값으로 수정 #432 * refactor: FE리뷰어에서 PR작성자는 제외하도록 코드 수정 #432 * refactor: 필요없는 디버깅 코드 삭제 및 pr 트리거 삭제 #432 * refactor: 알림 정상 작동 확인 트리거 추가 #432 * refactor: PR 트리거 삭제 #432 * refactor: 다시 대기화면으로 못돌아오도록 navigate replace: true 추가 #427 --------- Co-authored-by: PgmJun <[email protected]> Co-authored-by: rbgksqkr <[email protected]> Co-authored-by: useon <[email protected]> Co-authored-by: Yuseon Kim(썬데이) <[email protected]>
2 parents 1f9d62c + f6be80c commit 96577d8

File tree

206 files changed

+2321
-1670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+2321
-1670
lines changed

.github/workflows/be-cd-dev.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,19 @@ jobs:
4242
with:
4343
name: app-artifact
4444
path: ./backend/build/libs/app.jar
45+
if-no-files-found: error
46+
47+
- name: Upload deploy scripts
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: deploy-scripts
51+
path: ./backend/scripts/dev/
52+
if-no-files-found: error
4553

4654
deploy:
4755
needs: build
4856
timeout-minutes: 2
49-
runs-on: [ self-hosted, linux, ARM64, dev ]
57+
runs-on: [ dev, X64, Linux ]
5058

5159
steps:
5260
- name: Download artifact file
@@ -55,8 +63,14 @@ jobs:
5563
name: app-artifact
5664
path: ~/app
5765

66+
- name: Download deploy scripts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: deploy-scripts
70+
path: ~/app/scripts
71+
5872
- name: Replace application to latest
59-
run: sudo sh ~/scripts/replace-new-version.sh
73+
run: sudo sh ~/app/scripts/replace-new-version.sh
6074

6175
- name: Health check latest application
62-
run: sudo sh ~/scripts/health-check.sh
76+
run: sudo sh ~/app/scripts/health-check.sh

.github/workflows/be-cd-prod.yml

+28-75
Original file line numberDiff line numberDiff line change
@@ -16,114 +16,67 @@ jobs:
1616
secrets:
1717
secret_yml: ${{ secrets.PROD_SECRET_YML }}
1818

19-
deploy-a:
19+
deploy:
2020
needs: [ build ]
2121
uses: ./.github/workflows/blue-green.yml
2222
with:
23-
self_hosted_runner: prod-a
23+
self_hosted_runner: prod
2424
artifact_name: ${{ needs.build.outputs.artifact_name }}
2525
jar_name: ${{ needs.build.outputs.jar_name }}
2626
profile: prod
2727
app_path: ~/app
2828

29-
deploy-b:
30-
needs: [ build ]
31-
uses: ./.github/workflows/blue-green.yml
32-
with:
33-
self_hosted_runner: prod-b
34-
artifact_name: ${{ needs.build.outputs.artifact_name }}
35-
jar_name: ${{ needs.build.outputs.jar_name }}
36-
profile: prod
37-
app_path: ~/app
38-
39-
rollback-a:
40-
name: "[Failure] Rollback Deploy A"
41-
needs: [ deploy-a, deploy-b ]
42-
if: failure() && (needs.deploy-a.result == 'failure' || needs.deploy-b.result == 'failure')
43-
uses: ./.github/workflows/shutdown.yml
44-
with:
45-
self_hosted_runner: prod-a
46-
port: ${{ needs.deploy-a.outputs.green_port }}
47-
48-
rollback-b:
49-
name: "[Failure] Rollback Deploy B"
50-
needs: [ deploy-a, deploy-b ]
51-
if: failure() && (needs.deploy-a.result == 'failure' || needs.deploy-b.result == 'failure')
29+
rollback:
30+
name: "[Failure] Rollback Deploy"
31+
needs: deploy
32+
if: failure() && needs.deploy.result == 'failure'
5233
uses: ./.github/workflows/shutdown.yml
5334
with:
54-
self_hosted_runner: prod-b
55-
port: ${{ needs.deploy-b.outputs.green_port }}
35+
self_hosted_runner: prod
36+
port: ${{ needs.deploy.outputs.green_port }}
5637

5738
deploy-failure-notification:
5839
name: "[Failure] Deploy Failure Notification"
59-
needs: [ deploy-a, deploy-b ]
60-
if: failure() && (needs.deploy-a.result == 'failure' || needs.deploy-b.result == 'failure')
40+
needs: deploy
41+
if: failure() && needs.deploy.result == 'failure'
6142
runs-on: ubuntu-latest
6243
steps:
6344
- name: Send notification to Discord # todo
6445
run: echo "테스트입니다"
6546

66-
configure-nginx-a:
67-
needs: [ deploy-a, deploy-b ]
47+
configure-nginx:
48+
needs: deploy
6849
uses: ./.github/workflows/nginx-port-forwarding.yml
6950
with:
70-
self_hosted_runner: prod-a
51+
self_hosted_runner: prod
7152
app_path: ~/app
72-
old_port: ${{ needs.deploy-a.outputs.blue_port }}
73-
new_port: ${{ needs.deploy-a.outputs.green_port }}
53+
old_port: ${{ needs.deploy.outputs.blue_port }}
54+
new_port: ${{ needs.deploy.outputs.green_port }}
7455

75-
configure-nginx-b:
76-
needs: [ deploy-a, deploy-b ]
56+
rollback-nginx:
57+
name: "[Failure] Rollback Nginx"
58+
needs: configure-nginx
59+
if: failure() && (needs.configure-nginx.result == 'failure')
7760
uses: ./.github/workflows/nginx-port-forwarding.yml
7861
with:
79-
self_hosted_runner: prod-b
62+
self_hosted_runner: prod
8063
app_path: ~/app
81-
old_port: ${{ needs.deploy-b.outputs.blue_port }}
82-
new_port: ${{ needs.deploy-b.outputs.green_port }}
83-
84-
rollback-nginx-a:
85-
name: "[Failure] Rollback Nginx A"
86-
needs: [ configure-nginx-a, configure-nginx-b ]
87-
if: failure() && (needs.configure-nginx-a.result == 'failure' || needs.configure-nginx-b.result == 'failure')
88-
uses: ./.github/workflows/nginx-port-forwarding.yml
89-
with:
90-
self_hosted_runner: prod-a
91-
app_path: ~/app
92-
old_port: ${{ needs.configure-nginx-a.outputs.new_port }}
93-
new_port: ${{ needs.configure-nginx-a.outputs.old_port }}
94-
old_shutdown: true
95-
96-
rollback-nginx-b:
97-
name: "[Failure] Rollback Nginx B"
98-
needs: [ configure-nginx-a, configure-nginx-b ]
99-
if: failure() && (needs.configure-nginx-a.result == 'failure' || needs.configure-nginx-b.result == 'failure')
100-
uses: ./.github/workflows/nginx-port-forwarding.yml
101-
with:
102-
self_hosted_runner: prod-b
103-
app_path: ~/app
104-
old_port: ${{ needs.configure-nginx-b.outputs.new_port }}
105-
new_port: ${{ needs.configure-nginx-b.outputs.old_port }}
64+
old_port: ${{ needs.configure-nginx.outputs.new_port }}
65+
new_port: ${{ needs.configure-nginx.outputs.old_port }}
10666
old_shutdown: true
10767

10868
configure-nginx-faliure-notification:
10969
name: "[Failure] Nginx Failure Notification"
110-
needs: [ configure-nginx-a, configure-nginx-b ]
111-
if: failure() && (needs.configure-nginx-a.result == 'failure' || needs.configure-nginx-b.result == 'failure')
70+
needs: configure-nginx
71+
if: failure() && needs.configure-nginx.result == 'failure'
11272
runs-on: ubuntu-latest
11373
steps:
11474
- name: Send notification to Discord # todo
11575
run: echo "테스트입니다"
11676

117-
blue-shutdown-a:
118-
needs: [ configure-nginx-a, configure-nginx-b ]
119-
uses: ./.github/workflows/shutdown.yml
120-
with:
121-
self_hosted_runner: prod-a
122-
port: ${{ needs.configure-nginx-a.outputs.old_port }}
123-
124-
blue-shutdown-b:
125-
needs: [ configure-nginx-a, configure-nginx-b ]
77+
blue-shutdown:
78+
needs: configure-nginx
12679
uses: ./.github/workflows/shutdown.yml
12780
with:
128-
self_hosted_runner: prod-b
129-
port: ${{ needs.configure-nginx-b.outputs.old_port }}
81+
self_hosted_runner: prod
82+
port: ${{ needs.configure-nginx.outputs.old_port }}

.github/workflows/be-ci-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
build:
1313
timeout-minutes: 4
14-
runs-on: [ self-hosted, linux, ARM64, dev ]
14+
runs-on: ubuntu-latest
1515

1616
defaults:
1717
run:

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
run: |
6060
mkdir -p ${{ inputs.artifact_name }} && \
6161
mv build/libs/*.jar ${{ inputs.artifact_name }}/${{ inputs.jar_name }} && \
62-
mv scripts/* ${{ inputs.artifact_name }}/
62+
mv scripts/${{ inputs.profile }}/* ${{ inputs.artifact_name }}/
6363
6464
- name: Upload artifact file
6565
uses: actions/upload-artifact@v4

.github/workflows/fe-cd-dev.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: FE Build and Deploy for Develop
2+
3+
on:
4+
push:
5+
branches:
6+
- develop # develop 브랜치에서만 실행
7+
paths:
8+
- 'frontend/**' # frontend 폴더가 변경된 경우에만 실행
9+
10+
jobs:
11+
build-and-deploy:
12+
name: FE Build and Deploy for Prod
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
# 1. Setup Node.js (Version 20)
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 20
21+
22+
# 2. Repository Checkout
23+
- name: Checkout Code
24+
uses: actions/checkout@v3
25+
26+
# 3. Generate .env File from Individual Secrets
27+
- name: Generate .env File
28+
working-directory: ./frontend
29+
run: |
30+
echo "API_BASE_URL=${{ secrets.API_BASE_URL_DEV }}" >> .env
31+
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
32+
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> .env
33+
34+
# 4. Install Dependencies
35+
- name: Install Dependencies
36+
working-directory: ./frontend
37+
run: npm install
38+
39+
# 5. Build Project
40+
- name: Build for Dev
41+
working-directory: ./frontend
42+
run: npm run build:prod
43+
44+
# 6. Configure AWS CLI
45+
- name: Configure AWS CLI
46+
run: |
47+
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
48+
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
49+
aws configure set default.region ${{ secrets.AWS_REGION }}
50+
51+
# 7. Upload to S3
52+
- name: Upload to S3 (Dev)
53+
working-directory: ./frontend/dist
54+
run: |
55+
aws s3 sync . s3://${{ secrets.AWS_S3_BUCKET_DEV }} --delete
56+
57+
# 8. Invalidate CloudFront Cache
58+
- name: Invalidate CloudFront Cache (Dev)
59+
run: |
60+
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID_DEV }} --paths "/*"

.github/workflows/fe-cd-prod.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: FE Build and Deploy for Prod
2+
3+
on:
4+
push:
5+
branches:
6+
- main # main 브랜치에서만 실행
7+
paths:
8+
- 'frontend/**' # frontend 폴더가 변경된 경우에만 실행
9+
10+
jobs:
11+
build-and-deploy:
12+
name: FE Build and Deploy for Prod
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
# 1. Setup Node.js (Version 20)
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 20
21+
22+
# 2. Repository Checkout
23+
- name: Checkout Code
24+
uses: actions/checkout@v3
25+
26+
# 3. Generate .env File from Individual Secrets
27+
- name: Generate .env File
28+
working-directory: ./frontend
29+
run: |
30+
echo "API_BASE_URL=${{ secrets.API_BASE_URL_PROD }}" >> .env
31+
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
32+
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> .env
33+
34+
# 4. Install Dependencies
35+
- name: Install Dependencies
36+
working-directory: ./frontend
37+
run: npm install
38+
39+
# 5. Build Project
40+
- name: Build for Prod
41+
working-directory: ./frontend
42+
run: npm run build:prod
43+
44+
# 6. Configure AWS CLI
45+
- name: Configure AWS CLI
46+
run: |
47+
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
48+
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
49+
aws configure set default.region ${{ secrets.AWS_REGION }}
50+
51+
# 7. Upload to S3
52+
- name: Upload to S3 (Prod)
53+
working-directory: ./frontend/dist
54+
run: |
55+
aws s3 sync . s3://${{ secrets.AWS_S3_BUCKET_PROD }} --delete
56+
57+
# 8. Invalidate CloudFront Cache
58+
- name: Invalidate CloudFront Cache (Prod)
59+
run: |
60+
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID_PROD }} --paths "/*"

0 commit comments

Comments
 (0)