diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml new file mode 100644 index 000000000..2c4be9a61 --- /dev/null +++ b/.github/workflows/chromatic.yml @@ -0,0 +1,37 @@ +name: Chromatic PR + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + + - name: Install dependencies + run: npm ci + + - run: npx nx run-many -t build -p @ory/elements-react -p @ory/elements + + - run: npx nx run-many --all -t build-storybook -- --stats-json + + - uses: chromaui/action@v11.7.0 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + exitOnceUploaded: true + workingDir: packages/legacy-stories + storybookBuildDir: storybook-static + onlyChanged: true + - uses: chromaui/action@v11.7.0 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN_ELEMENTS_REACT }} + exitOnceUploaded: true + workingDir: packages/elements-react-stories + storybookBuildDir: storybook-static + onlyChanged: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ffcb7fe5..1e06ec89e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,18 +46,6 @@ jobs: examples/nextjs-spa/playwright-report/ examples/nextjs-spa/test-results/ retention-days: 7 - - uses: chromaui/action@v11.7.0 - with: - projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - exitOnceUploaded: true - workingDir: packages/legacy-stories - storybookBuildDir: storybook-static - - uses: chromaui/action@v11.7.0 - with: - projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN_ELEMENTS_REACT }} - exitOnceUploaded: true - workingDir: packages/elements-react-stories - storybookBuildDir: storybook-static - name: Upload results to Codecov uses: codecov/codecov-action@v4 diff --git a/nx.json b/nx.json index 0c6aa0301..e3f9f7821 100644 --- a/nx.json +++ b/nx.json @@ -49,7 +49,7 @@ "plugin": "@nx/storybook/plugin", "options": { "serveStorybookTargetName": "storybook", - "buildStorybookTargetName": "build", + "buildStorybookTargetName": "build-storybook", "testStorybookTargetName": "test-storybook", "staticStorybookTargetName": "static-storybook" }