config: chromatic-report.yml 자동화 스크립트 추가 #9
This file contains 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
# Workflow name | |
name: 'Chromatic Deployment' | |
# Event for the workflow | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# List of jobs | |
jobs: | |
test: | |
# Operating System | |
runs-on: ubuntu-latest | |
# Job steps | |
steps: | |
- name: Read .nvmrc | |
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | |
id: nvm | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.nvm.outputs.NVMRC }} | |
- name: Corepack Enable | |
run: corepack enable | |
- uses: actions/checkout@v1 | |
- run: yarn | |
#👇 Adds Chromatic as a step in the workflow | |
- uses: chromaui/action@v1 | |
# Options required for Chromatic's GitHub Action | |
id: chromatic | |
with: | |
#👇 Chromatic projectToken, see https://storybook.js.org/tutorials/intro-to-storybook/react/ko/deploy/ to obtain it | |
projectToken: ${{ secrets.CHROMATIC_PAGE_TOKEN }} | |
- name: Save PR number and Chromatic build outputs | |
run: | | |
mkdir -p ./pr | |
echo "${{ github.event.pull_request.number }}" > ./pr/prNumber | |
echo "${{ steps.chromatic.outputs.storybookUrl }}" > ./pr/storybookUrl | |
echo "${{ steps.chromatic.outputs.buildUrl }}" > ./pr/buildUrl | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pr | |
path: pr/ |