CDP-222 fix๐ (ci): ci ๋น๋ ์์ #153
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: Frontend-CI | |
| on: | |
| # ๋ฐฐํฌ ๊ฒ์ดํธ: main์ผ๋ก ๊ฐ๋ PR์์๋ง CI ์คํ | |
| pull_request: | |
| branches: [main] | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| # ๋น ๋ฅธ ํผ๋๋ฐฑ: ์์ ๋ธ๋์น์ push๋ ๋ CI ์คํ (โ ๏ธ ๋๋ฌธ์ ๋ค์ด๋ฐ๋ง ํ์ฉ) | |
| push: | |
| branches: | |
| - "Feature/**" | |
| - "Fix/**" | |
| - "Chore/**" | |
| - "Docs/**" | |
| - "Test/**" | |
| - "Refactor/**" | |
| # (์ ํ) Actions ํญ์์ ์๋ ์คํ ๋ฒํผ | |
| workflow_dispatch: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| env: | |
| NODE_VERSION: "20.19.2" | |
| CI: "true" | |
| jobs: | |
| lint: | |
| name: Style & Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: ${{ runner.os }}-pnpm- | |
| - run: pnpm install --frozen-lockfile | |
| - name: Prettier check | |
| run: pnpm run --if-present format:check | |
| - name: ESLint | |
| run: pnpm run --if-present lint | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| timeout-minutes: 15 | |
| # โ ํ ์คํธ ๋จ๊ณ์์๋ env ํ์ํ ๊ฒฝ์ฐ๊ฐ ๋ง์์ ๊ฐ์ด ์ฃผ์ | |
| env: | |
| NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} | |
| NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }} | |
| SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} | |
| NEXT_PUBLIC_API_TIMEOUT: "10000" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: ${{ runner.os }}-pnpm- | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run --if-present test -- --ci | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| timeout-minutes: 15 | |
| # โ ์ฌ๊ธฐ์ supabaseUrl required ํฐ์ง๋ ์์ธ ํด๊ฒฐ: build์ env ์ฃผ์ | |
| env: | |
| NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} | |
| NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }} | |
| SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} | |
| NEXT_PUBLIC_API_TIMEOUT: "10000" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: ${{ runner.os }}-pnpm- | |
| - run: pnpm install --frozen-lockfile | |
| - name: Check env exists | |
| run: | | |
| test -n "$NEXT_PUBLIC_SUPABASE_URL" || (echo "NEXT_PUBLIC_SUPABASE_URL missing" && exit 1) | |
| test -n "$NEXT_PUBLIC_SUPABASE_ANON_KEY" || (echo "NEXT_PUBLIC_SUPABASE_ANON_KEY missing" && exit 1) | |
| test -n "$SUPABASE_SERVICE_ROLE_KEY" || (echo "SUPABASE_SERVICE_ROLE_KEY missing" && exit 1) | |
| # (์ ํ) Next.js ๋น๋ ์บ์ | |
| # - uses: actions/cache@v4 | |
| # with: | |
| # path: | | |
| # .next/cache | |
| # key: ${{ runner.os }}-next-${{ hashFiles('pnpm-lock.yaml', 'next.config.*', '**/*.{ts,tsx,js,jsx,css,scss,md,mdx}') }} | |
| # restore-keys: ${{ runner.os }}-next- | |
| - run: pnpm run build |