From 6cb5150ad522e8954fb57e6225e438c145c05e62 Mon Sep 17 00:00:00 2001 From: Jonas Hungershausen Date: Tue, 5 Nov 2024 15:53:01 +0100 Subject: [PATCH] chore(ci): enable turbosnap (#257) --- .github/workflows/chromatic.yml | 39 +++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 12 ---------- nx.json | 2 +- 3 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/chromatic.yml diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml new file mode 100644 index 000000000..be16646b3 --- /dev/null +++ b/.github/workflows/chromatic.yml @@ -0,0 +1,39 @@ +name: Chromatic PR + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - 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" }