From a9fa283260a9127aad27f7b418729241017a20e0 Mon Sep 17 00:00:00 2001 From: yunho Date: Sat, 16 Sep 2023 14:20:17 +0900 Subject: [PATCH] chore: set chromatic github action script --- .github/workflows/chromatic.yml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/chromatic.yml diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml new file mode 100644 index 00000000..a8962cde --- /dev/null +++ b/.github/workflows/chromatic.yml @@ -0,0 +1,36 @@ +# Workflow name +name: 'Chromatic' + +# Event for the workflow +on: + pull_request: + branches: [main, develop] + push: + branches: [main, develop] + +# List of jobs +jobs: + chromatic-deployment: + # Operating System + runs-on: ubuntu-latest + # Job steps + steps: + - uses: actions/checkout@v1 + - name: Install dependencies + # ๐Ÿ‘‡ Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm + run: yarn + # ๐Ÿ‘‡ Adds Chromatic as a step in the workflow + - name: Publish to Chromatic + uses: chromaui/action@v1 + # Chromatic GitHub Action options + with: + # ๐Ÿ‘‡ Chromatic projectToken, refer to the manage page to obtain it. + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + buildScriptName: sb:build + onlyChanged: true + - name: comment PR + uses: thollander/actions-comment-pull-request@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + message: '๐Ÿš€storybook: ${{ steps.chromatic.outputs.storybookUrl }}'