From fedccac3c3e1b40da9636524e3737a766d152b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=90=E1=85=A2=E1=84=92=E1=85=AE?= =?UTF-8?q?=E1=86=AB?= Date: Fri, 26 Jul 2024 12:42:17 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20storybook=20=EB=B0=B0=ED=8F=AC?= =?UTF-8?q?=EB=A5=BC=20=EC=9C=84=ED=95=9C=20workflow=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/design-pull-request.yml | 54 +++++++++++++++++++++++ .github/workflows/design-push.yml | 43 ------------------ 2 files changed, 54 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/design-pull-request.yml delete mode 100644 .github/workflows/design-push.yml diff --git a/.github/workflows/design-pull-request.yml b/.github/workflows/design-pull-request.yml new file mode 100644 index 000000000..6f0cac858 --- /dev/null +++ b/.github/workflows/design-pull-request.yml @@ -0,0 +1,54 @@ +name: Storybook Deployment +run-name: ${{ github.actor }}의 스토리북 배포 +on: + pull_request: + branches: + - develop + paths: + - 'HDesign/**' + +jobs: + storybook: + runs-on: ubuntu-latest + outputs: + status: ${{ job.status }} + + defaults: + run: + shell: bash + working-directory: ./HDesign + + steps: + - name: checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: cache dependencies + id: cache + uses: actions/cache@v3 + with: + path: "**/node_modules" + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-storybook + + - name: depedency install + if: steps.cache.outputs.cache-hit != 'true' + run: npm ci + + - name: run lint + run: npm lint + + - name: publish to chromatic + id: chromatic + uses: chromaui/action@v1 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} + + - name: comment PR + uses: thollander/actions-comment-pull-request@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + message: "🚀storybook: ${{ steps.chromatic.outputs.storybookUrl }}" + \ No newline at end of file diff --git a/.github/workflows/design-push.yml b/.github/workflows/design-push.yml deleted file mode 100644 index f9cbb3a9b..000000000 --- a/.github/workflows/design-push.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: design-push - -on: - pull_request: - types: [opened, synchronize] - branches: [main, develop] - paths: - - 'HDesign/**' - -jobs: - build: - runs-on: ubuntu-latest - - defaults: - run: - shell: bash - working-directory: ./HDesign - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20.15.1' - - - name: Install dependencies - working-directory: ./HDesign - run: npm install - - - name: Run lint - working-directory: ./HDesign - run: npm run lint - - - name: Storybook build - working-directory: ./HDesign - run: npm run build-storybook - - - name: Chromatic - working-directory: ./HDesign - run: npx chromatic --project-token=${{ secrets.CHROMATIC_TOKEN }} - \ No newline at end of file