seueooo의 스토리북 배포 #231
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: Storybook Deployment | |
| run-name: ${{ github.actor }}의 스토리북 배포 | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| paths: | |
| - 'shared/**' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| deployments: write | |
| jobs: | |
| storybook-deploy: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| storybook_url: ${{ steps.chromatic.outputs.storybookUrl }} | |
| build_url: ${{ steps.chromatic.outputs.buildUrl }} | |
| status: ${{ job.status }} | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| run_install: false | |
| - name: setup node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: publish to chromatic | |
| id: chromatic | |
| uses: chromaui/action@latest | |
| with: | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| onlyChanged: true | |
| autoAcceptChanges: true | |
| comment-pr: | |
| runs-on: ubuntu-latest | |
| needs: [storybook-deploy] | |
| if: always() | |
| steps: | |
| - name: comment PR | |
| uses: thollander/actions-comment-pull-request@v3 | |
| with: | |
| comment-tag: storybook-${{ github.event.number }} | |
| message: | | |
| ## 🚀 Storybook 배포 | |
| **📖 Storybook:** ${{ needs.storybook-deploy.outputs.storybook_url }} | |
| **🔗 Chromatic Build:** ${{ needs.storybook-deploy.outputs.build_url }} | |
| **✅ Status:** ${{ needs.storybook-deploy.outputs.status }} |