From 60a44f402ff5be155334ced0f0ff3cf4676489df Mon Sep 17 00:00:00 2001 From: Armin Teimouri Date: Wed, 21 Oct 2026 15:58:54 +0300 Subject: [PATCH 1/2] ci: deploy docs to Cloudflare Workers with GitHub Actions Pushes to docs/v3 run wrangler deploy (served at docs-next.walletconnect.com). Same-repo PRs upload a version with a pr- preview alias and comment the URL. Replaces the Workers Builds references in README and AGENTS.md. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/deploy.yml | 56 ++++++++++++++++++++++++++++++++++++ AGENTS.md | 2 +- README.md | 2 +- wrangler.jsonc | 4 +++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..9bda4e0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: Deploy + +on: + push: + # docs/v3 deploys to docs-next.walletconnect.com during QA. Switch to main at cutover. + branches: [docs/v3] + pull_request: + +permissions: + contents: read + pull-requests: write + +concurrency: + group: deploy-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + deploy: + # Fork PRs get no secrets + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 11 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - run: pnpm install --frozen-lockfile + - run: pnpm build + + - name: Deploy + if: github.event_name == 'push' + run: pnpm exec wrangler deploy + + - name: Upload preview + if: github.event_name == 'pull_request' + id: preview + run: | + pnpm exec wrangler versions upload --preview-alias "pr-${{ github.event.pull_request.number }}" | tee upload.log + url=$(grep -oE 'https://pr-[^ ]+\.workers\.dev' upload.log | head -1) + echo "url=$url" >> "$GITHUB_OUTPUT" + + - name: Comment preview URL + if: github.event_name == 'pull_request' && steps.preview.outputs.url != '' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr comment "${{ github.event.pull_request.number }}" --edit-last --create-if-none \ + --body "Preview: ${{ steps.preview.outputs.url }} (commit ${{ github.event.pull_request.head.sha }})" diff --git a/AGENTS.md b/AGENTS.md index ca1b72b..ac6a560 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -234,7 +234,7 @@ curl -H 'Accept: text/markdown' localhost:8787/wallets/android/usage curl -I localhost:8787/nope # 404 ``` -Deploys run in Workers Builds: `main` goes to production, and every other branch gets a preview URL. Don't run `wrangler deploy` or `pnpm run deploy` yourself, and don't change Cloudflare settings or DNS, unless you're asked to. +Deploys run in the `Deploy` GitHub Actions workflow (`.github/workflows/deploy.yml`): pushes to `docs/v3` go to `docs-next.walletconnect.com` (`main` and `docs.walletconnect.com` after the Mintlify cutover), and every PR gets a preview URL. Custom domains are managed by Terraform in `WalletConnect/infra`, so don't add `routes` to `wrangler.jsonc`. Don't run `wrangler deploy` or `pnpm run deploy` yourself, and don't change Cloudflare settings or DNS, unless you're asked to. ## Writing style diff --git a/README.md b/README.md index d130d47..6437604 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The site is a static export (`output: 'export'`) served by Cloudflare Workers St - `out/`: every page, `/api/search.json`, `/llms*.txt`, the `.md` files, and OG images, all built by `pnpm build`. - `worker/index.ts`: runs in front of page URLs and handles the redirects from `redirects.json`, `/.md`, and Markdown for clients sending `Accept: text/markdown`. Anything else is served straight from `out/`; unknown URLs get `out/404.html`. -- Deploys: Workers Builds deploys `main` to production and posts a preview URL for every other branch. `pnpm run deploy` deploys by hand. +- Deploys: the `Deploy` GitHub Actions workflow (`.github/workflows/deploy.yml`) runs `wrangler deploy` on every push to `docs/v3`, served at `docs-next.walletconnect.com` (`main` and `docs.walletconnect.com` after the Mintlify cutover). Every PR gets a preview URL in a PR comment. `pnpm run deploy` deploys by hand. ## Project layout diff --git a/wrangler.jsonc b/wrangler.jsonc index 2218859..28ea140 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -3,6 +3,10 @@ "name": "walletconnect-docs", "main": "worker/index.ts", "compatibility_date": "2026-10-06", + // Custom domains (docs-next, later docs.walletconnect.com) are bound by Terraform in + // WalletConnect/infra. Don't add routes here. workers.dev stays on for PR preview URLs. + "workers_dev": true, + "preview_urls": true, "assets": { // `pnpm build` (output: 'export' in next.config.mjs) "directory": "./out", From 231562c02c552f82a93aa224d770ced127e3701b Mon Sep 17 00:00:00 2001 From: Armin Teimouri Date: Wed, 21 Oct 2026 16:01:51 +0300 Subject: [PATCH 2/2] docs: warn against also connecting Workers Builds Co-Authored-By: Claude Opus 5.5 (1M context) --- AGENTS.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ac6a560..60cbe21 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -234,7 +234,7 @@ curl -H 'Accept: text/markdown' localhost:8787/wallets/android/usage curl -I localhost:8787/nope # 404 ``` -Deploys run in the `Deploy` GitHub Actions workflow (`.github/workflows/deploy.yml`): pushes to `docs/v3` go to `docs-next.walletconnect.com` (`main` and `docs.walletconnect.com` after the Mintlify cutover), and every PR gets a preview URL. Custom domains are managed by Terraform in `WalletConnect/infra`, so don't add `routes` to `wrangler.jsonc`. Don't run `wrangler deploy` or `pnpm run deploy` yourself, and don't change Cloudflare settings or DNS, unless you're asked to. +Deploys run in the `Deploy` GitHub Actions workflow (`.github/workflows/deploy.yml`): pushes to `docs/v3` go to `docs-next.walletconnect.com` (`main` and `docs.walletconnect.com` after the Mintlify cutover), and every PR gets a preview URL. Custom domains are managed by Terraform in `WalletConnect/infra`, so don't add `routes` to `wrangler.jsonc`. Don't connect Cloudflare Workers Builds to this repo: two deployers on one Worker overwrite each other. Don't run `wrangler deploy` or `pnpm run deploy` yourself, and don't change Cloudflare settings or DNS, unless you're asked to. ## Writing style diff --git a/README.md b/README.md index 6437604..511df4c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The site is a static export (`output: 'export'`) served by Cloudflare Workers St - `out/`: every page, `/api/search.json`, `/llms*.txt`, the `.md` files, and OG images, all built by `pnpm build`. - `worker/index.ts`: runs in front of page URLs and handles the redirects from `redirects.json`, `/.md`, and Markdown for clients sending `Accept: text/markdown`. Anything else is served straight from `out/`; unknown URLs get `out/404.html`. -- Deploys: the `Deploy` GitHub Actions workflow (`.github/workflows/deploy.yml`) runs `wrangler deploy` on every push to `docs/v3`, served at `docs-next.walletconnect.com` (`main` and `docs.walletconnect.com` after the Mintlify cutover). Every PR gets a preview URL in a PR comment. `pnpm run deploy` deploys by hand. +- Deploys: the `Deploy` GitHub Actions workflow (`.github/workflows/deploy.yml`) runs `wrangler deploy` on every push to `docs/v3`, served at `docs-next.walletconnect.com` (`main` and `docs.walletconnect.com` after the Mintlify cutover). Every PR gets a preview URL in a PR comment. `pnpm run deploy` deploys by hand. Don't also connect Cloudflare Workers Builds, or the two deployers overwrite each other. ## Project layout