필요 없는 파일 제거 및 CI 구성 #2
Workflow file for this run
This file contains hidden or 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: OctoDocs CI Pipeline | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| setup-backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: "23" | |
| # 백엔드 의존성 캐시 설정 | |
| - name: Cache Yarn dependencies for backend | |
| uses: actions/cache@v2 | |
| with: | |
| path: backend/node_modules | |
| key: ${{ runner.os }}-backend-yarn-${{ hashFiles('**/backend/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-backend-yarn- | |
| # 백엔드 의존성 설치 | |
| - name: Install backend dependencies | |
| working-directory: ./backend | |
| run: yarn install | |
| # 백엔드 의존성 아티팩트 업로드 | |
| - name: Save backend node_modules as artifact | |
| uses: actions/upload-artifact@v3 # Updated to v3 | |
| with: | |
| name: backend_node_modules | |
| path: backend/node_modules | |
| setup-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: "23" | |
| # 프론트엔드 의존성 캐시 설정 | |
| - name: Cache Yarn dependencies for frontend | |
| uses: actions/cache@v2 | |
| with: | |
| path: frontend/node_modules | |
| key: ${{ runner.os }}-frontend-yarn-${{ hashFiles('**/frontend/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-frontend-yarn- | |
| # 프론트엔드 의존성 설치 | |
| - name: Install frontend dependencies | |
| working-directory: ./frontend | |
| run: yarn install | |
| # 프론트엔드 의존성 아티팩트 업로드 | |
| - name: Save frontend node_modules as artifact | |
| uses: actions/upload-artifact@v3 # Updated to v3 | |
| with: | |
| name: frontend_node_modules | |
| path: frontend/node_modules | |
| backend-lint: | |
| runs-on: ubuntu-latest | |
| needs: setup-backend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| # 백엔드 의존성 아티팩트 다운로드 | |
| - name: Restore backend node_modules | |
| uses: actions/download-artifact@v3 # Updated to v3 | |
| with: | |
| name: backend_node_modules | |
| path: backend/node_modules | |
| # 백엔드 린트 실행 | |
| - name: Run backend lint | |
| working-directory: ./backend | |
| run: yarn lint | |
| continue-on-error: true | |
| # 백엔드 린트 경고 포스트 | |
| - name: Post backend lint warning if any | |
| if: failure() | |
| run: echo "⚠️ 백엔드 lint 실행 도중 경고가 발생했습니다. 확인해주세요." | |
| frontend-lint: | |
| runs-on: ubuntu-latest | |
| needs: setup-frontend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| # 프론트엔드 의존성 아티팩트 다운로드 | |
| - name: Restore frontend node_modules | |
| uses: actions/download-artifact@v3 # Updated to v3 | |
| with: | |
| name: frontend_node_modules | |
| path: frontend/node_modules | |
| # 프론트엔드 린트 실행 | |
| - name: Run frontend lint | |
| working-directory: ./frontend | |
| run: yarn lint | |
| continue-on-error: true | |
| # 프론트엔드 린트 경고 포스트 | |
| - name: Post frontend lint warning if any | |
| if: failure() | |
| run: echo "⚠️ 프론트엔드 lint 실행 도중 경고가 발생했습니다. 확인해주세요." | |
| backend-build: | |
| runs-on: ubuntu-latest | |
| needs: setup-backend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| # 백엔드 의존성 아티팩트 다운로드 | |
| - name: Restore backend node_modules | |
| uses: actions/download-artifact@v3 # Updated to v3 | |
| with: | |
| name: backend_node_modules | |
| path: backend/node_modules | |
| # 백엔드 빌드 실행 | |
| - name: Run backend build | |
| working-directory: ./backend | |
| run: yarn build | |
| frontend-build: | |
| runs-on: ubuntu-latest | |
| needs: setup-frontend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| # 프론트엔드 의존성 아티팩트 다운로드 | |
| - name: Restore frontend node_modules | |
| uses: actions/download-artifact@v3 # Updated to v3 | |
| with: | |
| name: frontend_node_modules | |
| path: frontend/node_modules | |
| # 프론트엔드 빌드 실행 | |
| - name: Run frontend build | |
| working-directory: ./frontend | |
| run: yarn build | |
| backend-test: | |
| runs-on: ubuntu-latest | |
| needs: [setup-backend, backend-build] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| # 백엔드 의존성 아티팩트 다운로드 | |
| - name: Restore backend node_modules | |
| uses: actions/download-artifact@v3 # Updated to v3 | |
| with: | |
| name: backend_node_modules | |
| path: backend/node_modules | |
| # 백엔드 테스트 실행 | |
| - name: Run backend tests | |
| working-directory: ./backend | |
| run: yarn test |