Skip to content

Commit 041fd41

Browse files
authored
Update CONTRIBUTING.md for Cloudflare Workers deployment (withastro#14055)
1 parent 3e5e72f commit 041fd41

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ This will let the Astro docs team know you have some changes to propose. At this
168168

169169
Please include a clear title. The description will be pre-filled with questions that you can answer by editing right in the text field.
170170

171-
Every pull request generates a preview of the docs site, including your proposed changes, using **Netlify** for anyone to see.
171+
Every pull request generates a preview of the docs site, including your proposed changes, using **Cloudflare Workers** for anyone to see.
172172

173-
Use the **Deploy Preview** link in your pull request to review and share your changes.
173+
Use the **Preview deployment** link in your pull request to review and share your changes.
174174

175175
The docs site will be automatically updated whenever pull requests are merged.
176176

@@ -204,6 +204,28 @@ In the terminal on your computer:
204204
2. Click <kbd>Install</kbd>
205205
3. Follow the instructions to select your fork
206206

207+
## Creating a Version Branch
208+
209+
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:
210+
211+
### 1. On the new version branch
212+
213+
After branching from `main`, update these files:
214+
215+
- **`wrangler.jsonc`** — Change the `name` field to match the version (e.g. `"name": "docs-v7"`).
216+
- **`astro.config.ts`** — Change the `site` URL to the versioned subdomain (e.g. `'https://v7.docs.astro.build/'`).
217+
218+
### 2. On `main`
219+
220+
Update `.github/workflows/deploy.yml` to include the new version branch:
221+
222+
- Add the branch name to the `push.branches` list (e.g. `[main, v4, v5, v6, v7]`).
223+
- Add a corresponding `github.ref == 'refs/heads/v7'` condition to the Deploy step's `if` block.
224+
225+
### 3. In the Cloudflare dashboard
226+
227+
- 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`).
228+
207229
## Next Steps
208230

209231
- [Read the docs](https://docs.astro.build/)

0 commit comments

Comments
 (0)