Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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 }})"
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`, `/<page>.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. Don't also connect Cloudflare Workers Builds, or the two deployers overwrite each other.

## Project layout

Expand Down
4 changes: 4 additions & 0 deletions wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading