From bd13300f0e3f5eb1e3b63a74fb01412d4d6fa452 Mon Sep 17 00:00:00 2001 From: Youngjin Park Date: Mon, 20 Nov 2023 05:31:09 +0900 Subject: [PATCH 1/7] =?UTF-8?q?chore:=20=EC=8A=A4=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EB=B6=81=20=EB=B9=8C=EB=93=9C=ED=8C=8C=EC=9D=BC=20gitignore=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/.gitignore b/frontend/.gitignore index 8136e209b..825c3a22a 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -3,4 +3,5 @@ dist/ yarn-error.log .env.* -cypress/videos \ No newline at end of file +cypress/videos +storybook-static \ No newline at end of file From 6612fd11fdd8d7a6de157362aa0f0e1c037c189c Mon Sep 17 00:00:00 2001 From: Youngjin Park Date: Mon, 20 Nov 2023 05:31:39 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20=EC=8A=A4=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EB=B6=81=20=EB=B0=B0=ED=8F=AC=20actions=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/fe-storybook.yml | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/fe-storybook.yml diff --git a/.github/workflows/fe-storybook.yml b/.github/workflows/fe-storybook.yml new file mode 100644 index 000000000..219846b31 --- /dev/null +++ b/.github/workflows/fe-storybook.yml @@ -0,0 +1,49 @@ +name: Deploy Storybook + +on: + pull_request: + branches: develop + paths: + - frontend/** + +defaults: + run: + working-directory: ./frontend + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: write + concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: 'yarn' + cache-dependency-path: ${{ vars.FE_DIRECTORY }}/yarn.lock + + - name: Install dependencies + run: | + yarn install --frozen-lockfile + working-directory: ${{ vars.FE_DIRECTORY }} + + - name: Set PUBLIC_URL + run: | + PUBLIC_URL=$(echo $GITHUB_REPOSITORY | sed -r 's/^.+\/(.+)$/\/\1\//') + echo PUBLIC_URL=$PUBLIC_URL > .env + + - name: Build storybook + run: | + yarn build-storybook + + - name: Deploy to gh-pages branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./storybook-static From 55ef9501a3afed7ba1cfed170681970bb3b980e4 Mon Sep 17 00:00:00 2001 From: Youngjin Park Date: Mon, 20 Nov 2023 15:38:42 +0900 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20=EC=8A=A4=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EB=B6=81=20mockServiceWorker.js=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.storybook/preview.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/.storybook/preview.tsx b/frontend/.storybook/preview.tsx index 74719e4b2..be5f0d17d 100644 --- a/frontend/.storybook/preview.tsx +++ b/frontend/.storybook/preview.tsx @@ -13,7 +13,11 @@ import { QueryClientProvider } from '@tanstack/react-query'; import { queryClient } from '../src/App'; // msw init -initialize(); +initialize({ + serviceWorker: { + url: './mockServiceWorker.js', + }, +}); const preview: Preview = { parameters: { From 05b3861148aad5dba4232f0bb6d98f1b41cbb291 Mon Sep 17 00:00:00 2001 From: Youngjin Park Date: Mon, 20 Nov 2023 15:40:34 +0900 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20storybook=20actions=20=EB=B0=B0?= =?UTF-8?q?=ED=8F=AC=20=EB=94=94=EB=A0=89=ED=84=B0=EB=A6=AC=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/fe-storybook.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/fe-storybook.yml b/.github/workflows/fe-storybook.yml index 219846b31..2e8723d03 100644 --- a/.github/workflows/fe-storybook.yml +++ b/.github/workflows/fe-storybook.yml @@ -33,11 +33,6 @@ jobs: yarn install --frozen-lockfile working-directory: ${{ vars.FE_DIRECTORY }} - - name: Set PUBLIC_URL - run: | - PUBLIC_URL=$(echo $GITHUB_REPOSITORY | sed -r 's/^.+\/(.+)$/\/\1\//') - echo PUBLIC_URL=$PUBLIC_URL > .env - - name: Build storybook run: | yarn build-storybook @@ -46,4 +41,4 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./storybook-static + publish_dir: ./frontend/storybook-static From c5fb5056c071db79ea4f36cf9a423a9beb4b0679 Mon Sep 17 00:00:00 2001 From: Youngjin Park Date: Mon, 20 Nov 2023 15:53:05 +0900 Subject: [PATCH 5/7] =?UTF-8?q?refactor:=20storybook=20=EB=B0=B0=ED=8F=AC?= =?UTF-8?q?=20=EA=B2=BD=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/fe-storybook.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/fe-storybook.yml b/.github/workflows/fe-storybook.yml index 2e8723d03..13699d1f9 100644 --- a/.github/workflows/fe-storybook.yml +++ b/.github/workflows/fe-storybook.yml @@ -36,6 +36,8 @@ jobs: - name: Build storybook run: | yarn build-storybook + mkdir ./storybook-static/storybook + mv ./storybook-static/* ./storybook-static/storybook - name: Deploy to gh-pages branch uses: peaceiris/actions-gh-pages@v3 From 02727bc7115c64cb3cd87b1b57788b7a1e6f7315 Mon Sep 17 00:00:00 2001 From: Youngjin Park Date: Mon, 20 Nov 2023 19:26:56 +0900 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=EC=8A=A4=ED=86=A0=EB=A6=AC=EB=B6=81?= =?UTF-8?q?=20=EB=B9=8C=EB=93=9C=20=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/fe-storybook.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fe-storybook.yml b/.github/workflows/fe-storybook.yml index 13699d1f9..e8cfe5844 100644 --- a/.github/workflows/fe-storybook.yml +++ b/.github/workflows/fe-storybook.yml @@ -36,11 +36,11 @@ jobs: - name: Build storybook run: | yarn build-storybook - mkdir ./storybook-static/storybook - mv ./storybook-static/* ./storybook-static/storybook + mkdir ./dist + mv ./storybook-static ./dist/storybook - name: Deploy to gh-pages branch uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./frontend/storybook-static + publish_dir: ./frontend/dist From a804dda1a603fe7c6afd2184a424f2b53e24e6bc Mon Sep 17 00:00:00 2001 From: Youngjin Park Date: Sun, 24 Dec 2023 23:37:02 +0900 Subject: [PATCH 7/7] =?UTF-8?q?chore:=20=EC=8A=A4=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EB=B6=81=20=EB=B0=B0=ED=8F=AC=20yml=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/fe-storybook.yml | 32 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/fe-storybook.yml b/.github/workflows/fe-storybook.yml index e8cfe5844..3a86eb1b7 100644 --- a/.github/workflows/fe-storybook.yml +++ b/.github/workflows/fe-storybook.yml @@ -1,44 +1,50 @@ name: Deploy Storybook -on: - pull_request: - branches: develop +on: # 언제 실행? + pull_request: # PR을 날렸을 때 + branches: develop # develop 브랜치에서 paths: - - frontend/** + - frontend/** # 어떤 경로의 디렉터리에서 -defaults: +defaults: # 스크립트를 실행할 디렉터리 경로 run: working-directory: ./frontend jobs: deploy: - runs-on: ubuntu-latest - permissions: - contents: write - concurrency: + runs-on: ubuntu-latest # 실행 환경 + permissions: # workflow에 줄 권한 + contents: write # peaceiris/actions-gh-pages@v3에서 요구하는 설정: 쓰기권한 + concurrency: # 현재 스크립트가 한번만 실행되도록 해주는 옵션 group: ${{ github.workflow }} - cancel-in-progress: true + cancel-in-progress: true # 똑같은 group에서 이전에 실행중인 작업이 있다면 취소 steps: + # 레포지토리의 소스 코드를 사용한다. - uses: actions/checkout@v3 + + # node.js 런타임을 사용한다 . - name: Setup Node.js uses: actions/setup-node@v3 - with: + with: # 의존성 캐싱 옵션 node-version: '18.x' cache: 'yarn' cache-dependency-path: ${{ vars.FE_DIRECTORY }}/yarn.lock + # 의존성 설치 - name: Install dependencies run: | - yarn install --frozen-lockfile + yarn install --frozen-lockfile # 정확한 버전의 패키지 설치 (== npm ci) working-directory: ${{ vars.FE_DIRECTORY }} + # 스토리북 빌드 - name: Build storybook - run: | + run: | # 명령어 한줄 씩 실행 yarn build-storybook mkdir ./dist mv ./storybook-static ./dist/storybook + # gh-pages를 이용해 스토리북 빌드 파일 배포 - name: Deploy to gh-pages branch uses: peaceiris/actions-gh-pages@v3 with: