diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 8fb90c75..f47ed643 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,10 +1,11 @@ -name: Actions Workflow +name: Workflow on: pull_request: types: [opened, reopened, synchronize] jobs: build-project: #First Job is to check the code formatting, linting and build the project. + if: github.event.pull_request.draft == false name: Run Prettier, Lint and Build Checks runs-on: ubuntu-latest @@ -39,18 +40,15 @@ jobs: fi chromatic-deployment: #Second Job is to deploy the project to Chromatic - # Operating System - runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + name: Deploy Storybook to Chromatic + runs-on: ubuntu-latest # Operating System # Job steps steps: - name: Checkout Repository - uses: actions/checkout@v1 - - - name: Install Node.js - uses: actions/setup-node@v2 + uses: actions/checkout@v2 with: - node-version: 18 - + fetch-depth: 0 # 👈 Required to retrieve git history - name: Install dependencies run: npm install # 👇 Adds Chromatic as a step in the workflow diff --git a/package.json b/package.json index 153a25dd..568373b6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "lint": "next lint", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", - "prettier": "npx prettier . --check" + "prettier": "npx prettier . --check", + "chromatic": "chromatic --exit-zero-on-changes" }, "dependencies": { "autoprefixer": "10.4.16",