[CHORE] 미동작 CI 수정 #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- 'fe/**' # fe/로 시작하는 모든 브랜치에 대해 푸시 이벤트 트리거 | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x] | |
# Job 레벨에서 조건을 추가하여 소스 브랜치가 fe/로 시작하는 경우에만 실행 | |
if: startsWith(github.head_ref, 'fe/') | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
- name: Change to frontend directory | |
run: cd frontend | |
# Alternatively, set the working-directory for all subsequent steps: | |
# You can use the 'working-directory' attribute in each step. | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
working-directory: frontend | |
- name: Run ESLint | |
run: yarn lint | |
working-directory: frontend | |
- name: Type Check | |
run: yarn type-check | |
working-directory: frontend | |
- name: Run Tests | |
run: yarn test --coverage | |
working-directory: frontend | |
- name: Build | |
run: yarn build | |
working-directory: frontend | |
- name: Upload Artifacts | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts | |
path: frontend/build/ |