Skip to content

Merge pull request #23 from SEASONTHON-Wedit/main #12

Merge pull request #23 from SEASONTHON-Wedit/main

Merge pull request #23 from SEASONTHON-Wedit/main #12

Workflow file for this run

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 }}
# 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