From 2f3b9b9ed77490873bde746a2ddafb6027357a88 Mon Sep 17 00:00:00 2001 From: geofmureithi Date: Fri, 3 Apr 2026 13:37:57 +0300 Subject: [PATCH 1/7] chore: move to vercel --- .github/workflows/deploy.yml | 45 +++++++++++++++++++++++------ components/docs/components/tabs.tsx | 11 +++---- open-next.config.ts | 7 ----- package.json | 5 +--- wrangler.jsonc | 11 ------- 5 files changed, 43 insertions(+), 36 deletions(-) delete mode 100644 open-next.config.ts delete mode 100644 wrangler.jsonc diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3bf1b93..61973d8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,7 +1,9 @@ -name: Build and Deploy to Cloudflare +name: Build and Deploy to Vercel on: push: branches: [main] + pull_request: + branches: [main] jobs: deploy: @@ -19,23 +21,48 @@ jobs: run: | cargo build --release - # 2. Build Next.js for Cloudflare + # 2. Build Next.js - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' + - name: Install dependencies run: yarn install --immutable --immutable-cache --check-cache + - name: Build Next.js run: yarn build - - name: Build for Cloudflare - run: yarn deploy + # 3. Deploy to Vercel + - name: Install Vercel CLI + run: yarn global add vercel@latest + + - name: Pull Vercel Environment + run: | + vercel pull --yes \ + --environment=${{ github.event_name == 'pull_request' && 'preview' || 'production' }} \ + --token=${{ secrets.VERCEL_TOKEN }} + + - name: Deploy to Vercel + id: deploy + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}) + else + url=$(vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}) + fi + echo "url=$url" >> $GITHUB_OUTPUT - # 3. Deploy Prebuilt Artifacts to Cloudflare Workers - - name: Deploy to Cloudflare Workers - uses: cloudflare/wrangler-action@v3 + # 4. Comment preview URL on PR + - name: Comment Preview URL + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `✅ Preview deployed: ${{ steps.deploy.outputs.url }}` + }) diff --git a/components/docs/components/tabs.tsx b/components/docs/components/tabs.tsx index cfd2008..ee68071 100644 --- a/components/docs/components/tabs.tsx +++ b/components/docs/components/tabs.tsx @@ -78,10 +78,11 @@ function _Tabs({ onChange?.(index) }, []) // eslint-disable-line react-hooks/exhaustive-deps -- only on mount - const itemsWithFallback = items ?? - (Array.isArray(children) - ? Array.from({ length: children.length }, (_, i) => `Tab ${i}`) - : []) + const itemsWithFallback = React.useMemo(() => { + return ( + + ) + }, [children, items]) return ( diff --git a/open-next.config.ts b/open-next.config.ts deleted file mode 100644 index ec366fb..0000000 --- a/open-next.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -// default open-next.config.ts file created by @opennextjs/cloudflare -import { defineCloudflareConfig } from "@opennextjs/cloudflare/config"; -import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache"; - -export default defineCloudflareConfig({ -// incrementalCache: r2IncrementalCache, -}); diff --git a/package.json b/package.json index e0e794f..c347bfa 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "scripts": { "dev": "next dev", "build": "NODE_ENV=production next build", - "start": "next start", - "deploy": "opennextjs-cloudflare build" + "start": "next start" }, "dependencies": { "@emotion/is-prop-valid": "^1.3.0", @@ -40,7 +39,6 @@ "@contentlayer/source-files": "^0.3.4", "@mdx-js/mdx": "^3.0.1", "@mermaid-js/mermaid-cli": "^11.6.0", - "@opennextjs/cloudflare": "^1.18.0", "@shikijs/rehype": "^3.22.0", "@shikijs/transformers": "^3.22.0", "@tailwindcss/typography": "^0.5.14", @@ -67,7 +65,6 @@ "tailwindcss": "^3.3.2", "tailwindcss-animate": "^1.0.7", "typescript": "5.1.6", - "wrangler": "4.80.0" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/wrangler.jsonc b/wrangler.jsonc deleted file mode 100644 index d5dea9a..0000000 --- a/wrangler.jsonc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "node_modules/wrangler/config-schema.json", - "name": "apalis-website", - "main": ".open-next/worker.js", - "compatibility_date": "2025-05-05", - "compatibility_flags": ["nodejs_compat"], // Required for next/og - "assets": { - "directory": ".open-next/assets", - "binding": "ASSETS" - } - } From aeb5ad0ea8cbc7f8e9cb94ac924296dbef4e2229 Mon Sep 17 00:00:00 2001 From: geofmureithi Date: Fri, 3 Apr 2026 13:43:07 +0300 Subject: [PATCH 2/7] chore: typo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c347bfa..456bdda 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "shiki": "^3.22.0", "tailwindcss": "^3.3.2", "tailwindcss-animate": "^1.0.7", - "typescript": "5.1.6", + "typescript": "5.1.6" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } From 0aa7b89ca24f1ff5561fba33f39d1e5cb2d2a685 Mon Sep 17 00:00:00 2001 From: geofmureithi Date: Fri, 3 Apr 2026 14:02:22 +0300 Subject: [PATCH 3/7] chore: typo --- components/docs/components/tabs.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/docs/components/tabs.tsx b/components/docs/components/tabs.tsx index ee68071..be08bd0 100644 --- a/components/docs/components/tabs.tsx +++ b/components/docs/components/tabs.tsx @@ -80,7 +80,10 @@ function _Tabs({ const itemsWithFallback = React.useMemo(() => { return ( - + items ?? + (Array.isArray(children) + ? Array.from({ length: children.length }, (_, i) => `Tab ${i}`) + : []) ) }, [children, items]) From 3aab25207e1a51d18ee7029b02c800f4baa76778 Mon Sep 17 00:00:00 2001 From: geofmureithi Date: Fri, 3 Apr 2026 14:25:16 +0300 Subject: [PATCH 4/7] chore: vercel build --- .github/workflows/deploy.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 61973d8..6b51aec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,13 +39,23 @@ jobs: run: yarn global add vercel@latest - name: Pull Vercel Environment + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} run: | vercel pull --yes \ --environment=${{ github.event_name == 'pull_request' && 'preview' || 'production' }} \ --token=${{ secrets.VERCEL_TOKEN }} + - name: Build for Vercel + run: vercel build ${{ github.event_name != 'pull_request' && '--prod' || '' }} --token=${{ secrets.VERCEL_TOKEN }} + + - name: Deploy to Vercel id: deploy + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} run: | if [ "${{ github.event_name }}" == "pull_request" ]; then url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}) From 5e2140e12cb8d1360cd47d4940bb02b123ba8b5e Mon Sep 17 00:00:00 2001 From: geofmureithi Date: Fri, 3 Apr 2026 14:51:53 +0300 Subject: [PATCH 5/7] add: vercel.json --- vercel.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 vercel.json diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..492586b --- /dev/null +++ b/vercel.json @@ -0,0 +1,6 @@ +{ + "framework": "nextjs", + "installCommand": "yarn install --immutable", + "buildCommand": "yarn build", + "outputDirectory": ".next" +} From be2fe919ec3bf489e0e70f45cf304fb6a9cbc55e Mon Sep 17 00:00:00 2001 From: geofmureithi Date: Fri, 3 Apr 2026 15:32:24 +0300 Subject: [PATCH 6/7] chore: add permission and bin folder --- .github/workflows/deploy.yml | 2 ++ examples/src/bin/.include | 0 2 files changed, 2 insertions(+) create mode 100644 examples/src/bin/.include diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6b51aec..2cf4559 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,8 @@ on: jobs: deploy: runs-on: ubuntu-latest + permissions: + pull-requests: write steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/examples/src/bin/.include b/examples/src/bin/.include new file mode 100644 index 0000000..e69de29 From d5537e01eb77f8b5bc940d7233340adc7f281189 Mon Sep 17 00:00:00 2001 From: geofmureithi Date: Fri, 3 Apr 2026 16:01:22 +0300 Subject: [PATCH 7/7] chore: add permission --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2cf4559..54660c4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write + contents: read steps: - name: Checkout code uses: actions/checkout@v4