refactor: chromatic action yml fix (#172) #24
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: "Chromatic Deployment" | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
| # paths: | ||
| # - "**.stories.ts" | ||
| # - "**.stories.tsx" | ||
| # - "**.mdx" | ||
| jobs: | ||
| chromatic-deployment: | ||
| name: Chromatic | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| statis: ${{ job.status }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: 캐시 종속성 | ||
| id: cache | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: "**/node_modules" | ||
| key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}-storybook | ||
| - name: 종속성 설치 | ||
| if: steps.cache.outputs.cache-hit != 'true' | ||
| run: yarn install | ||
| # - name: Install dependencies | ||
| # run: yarn | ||
| - name: Publish to Chromatic | ||
| id: chromatic | ||
| uses: chromaui/action@latest | ||
| with: | ||
| exitZeroOnChanges: true | ||
| autoAcceptChanges: true | ||
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
| token: ${{ secrets.TOKEN }} | ||
| - name: 현재 시간 가져오기 | ||
| uses: josStorer/get-current-time@v2 | ||
| id: current-time | ||
| with: | ||
| format: "YYYY년 MM월 DD일 HH시 mm분 ss초" | ||
| utcOffset: "+09:00" | ||
| # - name: comment PR | ||
| # uses: thollander/actions-comment-pull-request@v3 | ||
| # env: | ||
| # GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
| # with: | ||
| # message: "storybook: ${{ steps.chromatic.outputs.storybookUrl }}" | ||
| outputs: | ||
| storybook_url: ${{ steps.chromatic.outputs.storybookUrl }} | ||
| currnent_time: ${{ steps.current-time.outputs.formattedTime }} | ||
| github-bot-storybook: | ||
| runs-on: ubuntu-latest | ||
| needs: [chromatic-deployment] | ||
| steps: | ||
| - name: PR 코멘트 남기기 | ||
| uses: thollander/actions-comment-pull-request@v3 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
| with: | ||
| comment_tag: ${{ github.event.number }}-storybook | ||
| message: | | ||
| 💄 Storybook: ${{ needs.storybook-preview.outputs.storybook_url }} | ||
| 🕖 Update: ${{ needs.storybook-preview.outputs.currnent_time }} | ||