From 594220c5f55826f1ee9695d5e9039dcb9a1e1696 Mon Sep 17 00:00:00 2001 From: Yo Iwamoto Date: Mon, 8 Apr 2024 21:08:48 +0900 Subject: [PATCH 1/3] inject CHROMATIC_PROJECT_TOKEN from repository secrets --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7f0e4be..f41890d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,6 +31,8 @@ jobs: run: pnpm check - name: UI Test + env: + CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} run: pnpm chromatic - name: Test From 5775b8ceb61e2cbb5313ec2e8b136d6e529e3228 Mon Sep 17 00:00:00 2001 From: Yo Iwamoto Date: Mon, 8 Apr 2024 21:12:04 +0900 Subject: [PATCH 2/3] use chromatic workflow --- .github/workflows/ci.yaml | 5 ----- .github/workflows/ui-test.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ui-test.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f41890d..4104574 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,10 +30,5 @@ jobs: - name: Lint run: pnpm check - - name: UI Test - env: - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - run: pnpm chromatic - - name: Test run: pnpm test diff --git a/.github/workflows/ui-test.yaml b/.github/workflows/ui-test.yaml new file mode 100644 index 0000000..ffb50aa --- /dev/null +++ b/.github/workflows/ui-test.yaml @@ -0,0 +1,28 @@ +name: "Chromatic" + +on: push + +jobs: + chromatic: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.9.0 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8.15.6 + run_install: true + + - name: Run Chromatic + uses: chromaui/action@latest + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} From cbf6faebc6ad2be6e414d6e0fb1703a8dc2e8b48 Mon Sep 17 00:00:00 2001 From: Yo Iwamoto Date: Mon, 8 Apr 2024 21:12:57 +0900 Subject: [PATCH 3/3] fix: build script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b8a4022..583c4f5 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "prepare": "git config core.hooksPath .githooks", "dev": "next dev", - "build": "pnpm build:content && pnpm build:next", + "build": "pnpm build:contents && pnpm build:next", "build:next": "next build", "build:contents": "tsx src/scripts/build-contents.ts", "start": "next start",