π· μ μ νμΌμ μμΆλμμ μΆκ° #3
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: CI Pipeline | |
| # μν¬νλ‘μ° μ€ν 쑰건 | |
| on: | |
| pull_request: | |
| branches: ["main", "dev"] | |
| push: | |
| branches: ["main", "dev", "feature/*"] | |
| # μ€νλ μμ (Job)λ€ | |
| jobs: | |
| # λΉλ λ° ν μ€νΈλ₯Ό λ΄λΉνλ λ©μΈ μμ | |
| build: | |
| # κ°μ νκ²½ μ§μ | |
| runs-on: ubuntu-latest | |
| # μμ λ¨κ³(Step)λ€ | |
| steps: | |
| # 1. λ ν¬μ§ν 리 μ½λ 체ν¬μμ | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| # 2. Node.js νκ²½ μ€μ | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" # μ€μ! -> νλ‘μ νΈμ λ§λ Node.js λ²μ μ§μ | |
| # 3. NPM μμ‘΄μ± μΊμ± (2λ¨κ³ Dependency Install μ΅μ ν) | |
| # - node_modules ν΄λλ₯Ό μΊμ±νμ¬ λ§€λ² μλ‘ μ€μΉνλ μκ° μ μ½ | |
| - name: Cache node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| # 4. μμ‘΄μ± μ€μΉ (2λ¨κ³ Dependency Install) | |
| # - CI νκ²½μμλ 'npm ci'λ₯Ό μ¬μ©νλ κ²μ΄ λ λΉ λ₯΄κ³ μμ μ . | |
| - name: Install Dependencies | |
| run: npm ci | |
| # 5. λΉλ μ ν¨μ± κ²μ¬ (3λ¨κ³ Build Validation) | |
| - name: Run Build | |
| run: npm run build |