Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] CI용 git actions 추가 #311

Merged
merged 7 commits into from
Apr 1, 2024
Merged

[Feat] CI용 git actions 추가 #311

merged 7 commits into from
Apr 1, 2024

Conversation

loevray
Copy link
Contributor

@loevray loevray commented Mar 31, 2024

📋 Issue Number

close #312

💻 구현 내용

  • main브랜치에 push시 자동배포하는 git actions를 추가하였습니다. 세부단계는 아래와 같습니다.
  1. 브랜치를 복제합니다(checkout)
  2. Node v20을 설치합니다
  3. yarn v4를 사용하기위하여 corepack을 enable상태로 변경합니다
  4. yarn 버전을 현재 저희 개발환경에서 사용중인 4.1.0으로 변경합니다
  5. 의존성을 설치합니다
  6. 빌드
  7. aws 인증정보를 셋팅합니다
  8. aws에 배포합니다. s3의 assets 폴더내부 파일을 재귀적으로 삭제 후 s3버킷에 현재 git actions 컨테이너의 ./dist 파일과 동기화합니다.
  9. cloudfront의 캐시를 무효화합니다(전부 무효)
  • vercel 배포에 비하여 총 배포시간 약 20%내외 감소하였습니다.
  • main브랜치에 pr시 build + test함수 검사하는 git actions를 추가하였습니다
  • 이제 package.json내부 packageManager프로퍼티 추가 및 lint-staged + husky 정상작동 합니다

📷 Screenshots

vercel 배포시간

image

aws 배포시간

image

🤔 고민사항

  1. yarn v4의 zero install 활용방안(경로문제...😐)
  2. yarn 캐싱 이용방안

@loevray loevray changed the title [Test] CICD 테스트용 PR입니다 [CI] CI용 git actions 추가 Apr 1, 2024
@loevray loevray self-assigned this Apr 1, 2024
@loevray loevray added the feat label Apr 1, 2024
@loevray loevray changed the title [CI] CI용 git actions 추가 [Feat] CI용 git actions 추가 Apr 1, 2024
Copy link
Contributor

@dlsxjzld dlsxjzld left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!! 배포 시간이 20%나 줄고 yarn berry를 쓸 수 있어서 좋네요 ㅎㅎ 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

build를 이렇게 테스트 할 수 있다니... 하나 배워갑니다!! 👍

runs-on: ubuntu-latest

steps:
- name: Checkout
Copy link
Contributor

Choose a reason for hiding this comment

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

궁금한 게 대소문자는 상관 없나요?! 🤔
ex) Checkout 과 checkout

Copy link
Contributor Author

@loevray loevray Apr 1, 2024

Choose a reason for hiding this comment

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

각 step의 이름입니다! 저희가 임의로 정할수 있더라구요ㅎㅎ
job(작업 정의)> step(작업을 단계별로 쪼개기) > name1, name2... 이런식으로 작동합니다!

https://github.com/Team-E2I4/Team-E2I4-TiKiTaza-FE/actions/runs/8505681422/job/23294583847?pr=311
링크 들어가보시면 파일 내 적혀있는 단계별 name이 그대로 반영된 걸 확인하실 수 있습니다!

@loevray loevray merged commit f6d17fa into main Apr 1, 2024
1 check passed
@loevray loevray deleted the DeployTest branch April 1, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] main브랜치 push, pr시 자동배포 git actions 추가
2 participants