Skip to content

Feature/CDP-185-LandingAnimation #125

Feature/CDP-185-LandingAnimation

Feature/CDP-185-LandingAnimation #125

Workflow file for this run

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
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
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
# (์„ ํƒ) 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