Update README.md #20
  
    
      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: Wedit FE CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-nextjs-and-storybook: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. GitHub λ ν¬μ§ν 리 체ν¬μμ | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # 2. npm μΊμ± | |
| - name: Cache npm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-npm- | |
| # 3. Node.js μ€μ  | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.18.0' | |
| # 4. μμ‘΄μ± μ€μΉ | |
| - name: Install dependencies | |
| run: npm ci | |
| # 5. NextJS λΉλ (warring 무μ) | |
| - name: Build Next.js SSR | |
| run: npm run build | |
| env: | |
| CI: false | |
| NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} | |
| NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }} | |
| NEXT_PUBLIC_KAKAO_REST_KEY: ${{ secrets.NEXT_PUBLIC_KAKAO_REST_KEY }} | |
| NEXT_PUBLIC_KAKAO_JAVASCRIPT_KEY: ${{ secrets.NEXT_PUBLIC_KAKAO_JAVASCRIPT_KEY }} | |
| # 6. Storybook λΉλ | |
| - name: Build Storybook | |
| run: npm run build-storybook -- --output-dir storybook-static | |
| # Debug: .next λλ ν 리 λ΄μ© νμΈ | |
| - name: List .next contents (debug) | |
| run: ls -alR .next | |
| # 7. NextJS λΉλ νμΌμ GitHub Artifactμ μ λ‘λ | |
| - name: Upload Next.js build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nextjs-build | |
| include-hidden-files: true | |
| path: | | |
| .next/ | |
| .next/**/* | |
| # 8. Storybook λΉλ νμΌμ GitHub Artifactμ μ λ‘λ | |
| - name: Upload public assets | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: public-assets | |
| path: public/ | |
| # 9. Storybook λΉλ νμΌμ GitHub Artifactμ μ λ‘λ | |
| - name: Upload Storybook artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: storybook-build | |
| path: storybook-static/ | |
| # 10. ν¨ν€μ§ νμΌ GitHub Artifactμ μ λ‘λ | |
| - name: Upload package files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package-files | |
| path: | | |
| package.json | |
| package-lock.json |