diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..837b4d8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + types: [opened, synchronize] + +jobs: + build: + name: Build and Test + timeout-minutes: 15 + runs-on: ubuntu-latest + env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ vars.TURBO_TEAM }} + + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 10 # 👈 Нужно что бы chromatic хорошо работал, пока пробуем глубину истории 10 + + - uses: pnpm/action-setup@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Lint & Test + run: pnpm run check + + - name: Publish to Chromatic + uses: chromaui/action@v1 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + workingDir: packages/ui + storybookBuildDir: storybook-static + onlyChanged: true + zip: true + exitOnceUploaded: true diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +20 diff --git a/apps/web/package.json b/apps/web/package.json index d86f266..27bccb9 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -5,11 +5,11 @@ "type": "module", "sideEffect": false, "scripts": { - "dev": "next dev --turbo", - "build": "next build", - "start": "next start", - "lint": "next lint", - "typecheck": "tsc" + "disabled:dev": "next dev --turbo", + "disabled:build": "next build", + "disabled:start": "next start", + "disabled:lint": "next lint", + "disabled:typecheck": "tsc" }, "dependencies": { "@sneg240/tailwind": "workspace:*", diff --git a/package.json b/package.json index ca76e66..e5e7386 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,6 @@ "prettier": "3.0.3", "turbo": "1.10.15" }, + "repository": "https://github.com/sneg240/frontend", "packageManager": "pnpm@8.6.10" } diff --git a/packages/ui/package.json b/packages/ui/package.json index 13de8ec..3294fa4 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -20,6 +20,7 @@ "@sneg240/tailwind": "workspace:*", "clsx": "2.0.0", "next": "13.5.4", + "chromatic": "7.2.3", "tailwindcss": "3.3.3" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8c34cb..84c59de 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -134,6 +134,9 @@ importers: '@sneg240/tailwind': specifier: workspace:* version: link:../tailwind + chromatic: + specifier: 7.2.3 + version: 7.2.3 clsx: specifier: 2.0.0 version: 2.0.0 @@ -5741,6 +5744,11 @@ packages: engines: {node: '>=10'} dev: true + /chromatic@7.2.3: + resolution: {integrity: sha512-UEcHB1nkPoHWoRybPzv6BOVqPr7PqDNuz3u8NCRg7KJciouOb20HjiUQx4Dh9mgA7JUsb2WeGHE2SG/0fHH0PA==} + hasBin: true + dev: false + /chrome-trace-event@1.0.3: resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} engines: {node: '>=6.0'} diff --git a/turbo.json b/turbo.json index fc1b686..b2255a6 100644 --- a/turbo.json +++ b/turbo.json @@ -4,7 +4,7 @@ "pipeline": { "build": { "dependsOn": ["^build"], - "outputs": [".next/**", "!.next/cache/**"] + "outputs": [".next/**", "!.next/cache/**", "storybook-static/**"] }, "check": { "dependsOn": ["lint", "typecheck"] @@ -14,9 +14,6 @@ "dev": { "cache": false, "persistent": true - }, - "crawl": { - "cache": false } } }