From 8325fdfead6b978dc564cddc7c32d2d225bea6ab Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 12 Jun 2026 16:04:03 -0400 Subject: [PATCH 1/3] Update CONTRIBUTING.md for Cloudflare Workers deployment - Replace Netlify references with Cloudflare Workers - Add 'Creating a Version Branch' section documenting the process for setting up versioned docs branches on new major releases --- CONTRIBUTING.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 111c6e777e1d1..c8880692f1ddd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -168,9 +168,9 @@ This will let the Astro docs team know you have some changes to propose. At this Please include a clear title. The description will be pre-filled with questions that you can answer by editing right in the text field. -Every pull request generates a preview of the docs site, including your proposed changes, using **Netlify** for anyone to see. +Every pull request generates a preview of the docs site, including your proposed changes, using **Cloudflare Workers** for anyone to see. -Use the **Deploy Preview** link in your pull request to review and share your changes. +Use the **Preview deployment** link in your pull request to review and share your changes. The docs site will be automatically updated whenever pull requests are merged. @@ -204,6 +204,28 @@ In the terminal on your computer: 2. Click Install 3. Follow the instructions to select your fork +## Creating a Version Branch + +When a new major version of Astro is released, the current `main` branch becomes a version branch (e.g. `v7`) to preserve the docs for that version. Since `main` already has the Cloudflare Workers deployment infrastructure, only a few changes are needed: + +### 1. On the new version branch + +After branching from `main`, update these files: + +- **`wrangler.jsonc`** — Change the `name` field to match the version (e.g. `"name": "docs-v7"`). +- **`astro.config.ts`** — Change the `site` URL to the versioned subdomain (e.g. `'https://v7.docs.astro.build/'`). + +### 2. On `main` + +Update `.github/workflows/deploy.yml` to include the new version branch: + +- Add the branch name to the `push.branches` list (e.g. `[main, v4, v5, v6, v7]`). +- Add a corresponding `github.ref == 'refs/heads/v7'` condition to the Deploy step's `if` block. + +### 3. In the Cloudflare dashboard + +- After the first successful deploy, go to the Worker's settings (e.g. `docs-v7`) -> **Domains & Routes** and add the custom domain (e.g. `v7.docs.astro.build`). + ## Next Steps - [Read the docs](https://docs.astro.build/) From bef6dd3a012aaf7eeaea2028eabe074a2ea2b6b8 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 12 Jun 2026 16:24:51 -0400 Subject: [PATCH 2/3] Pin wrangler v4 in deploy actions The wrangler-action defaults to wrangler 3.x which doesn't support wrangler.jsonc or the --preview-alias flag. --- .github/workflows/deploy-preview.yml | 1 + .github/workflows/deploy.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 1a882fe7633b9..93f2146e91349 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -84,6 +84,7 @@ jobs: uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + wranglerVersion: '4' command: versions upload --preview-alias "${{ steps.metadata.outputs.preview_alias }}" - name: Comment deployment complete diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 66d86e5ddc72a..f0480a8926ce3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -51,6 +51,7 @@ jobs: uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + wranglerVersion: '4' command: deploy - name: Upload build output From d467aeb4f7fa619817ac8e258f0d43dfcf9e2dba Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 12 Jun 2026 16:36:37 -0400 Subject: [PATCH 3/3] Upgrade wrangler-action from v3.15.0 to v4.0.0 The v3 action defaults to wrangler 3.x which doesn't support wrangler.jsonc or --preview-alias. The v4 action defaults to wrangler 4 natively. --- .github/workflows/deploy-preview.yml | 3 +-- .github/workflows/deploy.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 93f2146e91349..ba66013e2762d 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -81,10 +81,9 @@ jobs: github-token: ${{ github.token }} - name: Deploy preview - uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0 + uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - wranglerVersion: '4' command: versions upload --preview-alias "${{ steps.metadata.outputs.preview_alias }}" - name: Comment deployment complete diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f0480a8926ce3..9005a73efd638 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,10 +48,9 @@ jobs: github.ref == 'refs/heads/v5' || github.ref == 'refs/heads/v6' || github.ref == 'refs/heads/v7' - uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0 + uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - wranglerVersion: '4' command: deploy - name: Upload build output