Skip to content

ShinYoung-Kim의 Primitive UI 스토리북 배포 #58

ShinYoung-Kim의 Primitive UI 스토리북 배포

ShinYoung-Kim의 Primitive UI 스토리북 배포 #58

name: Primitive UI 스토리북 배포
run-name: ${{ github.actor }}의 Primitive UI 스토리북 배포
on:
pull_request:
branches:
- develop
paths:
- "packages/primitive/components/**/*"
permissions:
contents: read
pull-requests: write
jobs:
storybook:
runs-on: ubuntu-latest
steps:
- name: 레포지토리 체크아웃
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 환경 변수 설정
id: set-env
run: |
chmod +x ./scripts/set-env.sh
./scripts/set-env.sh
- name: node.js 설정
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: pnpm 설치
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: pnpm 의존성 캐시
id: cache-pnpm
uses: actions/cache@v4
with:
path: |
~/.pnpm-store
node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: 의존성 설치
run: |
chmod +x ./scripts/install-dependencies.sh
./scripts/install-dependencies.sh
- name: 토큰 존재 여부 체크
run: |
if [ -n "${{ secrets.PRIMITIVE_UI_CHROMATIC_TOKEN }}" ]; then
echo "PRIMITIVE_UI_CHROMATIC_TOKEN is set"
else
echo "PRIMITIVE_UI_CHROMATIC_TOKEN is not set"
fi
- name: chromatic에 배포
id: publish_chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.PRIMITIVE_UI_CHROMATIC_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
workingDir: packages/primitive
- name: chromatic 배포 URL 댓글 작성
uses: thollander/actions-comment-pull-request@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: "🐱 스토리북이 배포되었습니다: ${{ steps.publish_chromatic.outputs.url }} 🐱"