From 8fde35b4133eb33a3a47aca54874d1d6141b9d6e Mon Sep 17 00:00:00 2001 From: sanghun Date: Fri, 1 Nov 2024 23:13:46 +0900 Subject: [PATCH] =?UTF-8?q?chore=20:=20ci=20=EC=B5=9C=EC=B4=88=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..97264a7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: + - "**" # 모든 브랜치에 대해 CI 진행 + pull_request: + branches: + - "develop" # develop 브랜치에 대해 PR이 올라올 때 CI 진행 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # 1. 리포지토리 체크아웃 + - name: Check out repository + uses: actions/checkout@v3 + + # 2. frontend 디렉토리 내용 확인 (디버깅용) + - name: List frontend directory contents + run: ls -la react-app + + # 3. Node.js 설정 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' # 원하는 Node.js 버전을 지정 + + # 4. npm 캐시 설정 + - name: Configure npm cache + run: npm config set cache $(npm cache dir) --global + + # 5. 의존성 설치 + - name: Install dependencies + working-directory: react-app + run: npm install + + # 6. ESLint 실행 + - name: Run ESLint + working-directory: react-app + run: npm run lint # ESLint를 실행하는 스크립트를 `package.json`에 설정 + + # 7. 타입 체크 + - name: Run TypeScript check + working-directory: react-app + run: npm run type-check # 타입 체크를 위한 스크립트, `package.json`에 설정 필요 + + # 8. 빌드 실행 + - name: Build project + working-directory: react-app + run: npm run build