Skip to content

Commit 26d0364

Browse files
authored
docs: update deployment rules and preview settings docs [automated] (#16214)
* chore(docs): automated cloud documentation update * Replace pencil icon instructions with InlineIcon Updated instructions to use the PencilSquare icon for changing the linked branch. * Enhance preview environment settings documentation Added InlineIcon import for better UI management and clarified shared settings for preview environments, including provisioning and deploy rules. * Refine instructions for joining multiple conditions Clarified the instructions on joining multiple conditions in the preview environment setup. --------- Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
1 parent b61c1ff commit 26d0364

3 files changed

Lines changed: 28 additions & 21 deletions

File tree

www/apps/cloud/app/environments/long-lived/page.mdx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { InlineIcon, getOsShortcut, Kbd, Tabs, TabsList, TabsTrigger, TabsContent, TabsContentWrapper } from "docs-ui"
2-
import { EllipsisHorizontal, ChevronUpDown } from "@medusajs/icons"
2+
import { EllipsisHorizontal, ChevronUpDown, PencilSquare } from "@medusajs/icons"
33

44
export const metadata = {
55
title: `Long-Lived Environments`,
@@ -291,21 +291,18 @@ You can't change the branch of preview environments. This section only applies t
291291

292292
</Note>
293293

294-
In an environment's "Settings" tab, you can manage the deployment rules for the environment. Deployment rules allow you to control how and when deployments are triggered for the environment.
294+
In an environment's **Settings** tab, the **Deployment Rules** section lets you manage the branch the environment deploys from and configure conditions that control when deployments are triggered.
295295

296-
To change the branch associated with an environment using deployment rules:
296+
To change the branch associated with an environment:
297297

298-
1. In the [environment's dashboard](#open-environment-dashboard), click on the "Settings" tab.
299-
2. Choose the "Deployment rules" tab from the sidebar.
300-
3. Click the <InlineIcon Icon={EllipsisHorizontal} alt="three-dots" /> icon at the right side of the `branch` rule.
301-
4. Choose "Edit" from the dropdown menu.
302-
5. In the side window that opens, you can change the branch associated with the environment.
303-
6. Once you're done, click the "Save" button.
298+
1. In the [environment's dashboard](#open-environment-dashboard), click on the **Settings** tab.
299+
2. Choose **Deployment Rules** from the sidebar.
300+
3. In the **Linked branch** section, click the <InlineIcon Icon={PencilSquare} alt="pencil" /> icon next to the current branch name.
301+
4. In the side window that opens, enter the new branch name in the **Branch** field.
302+
5. Click **Save**.
304303

305304
Changes will take effect the next time you push a commit to the new branch. The environment will be redeployed with the latest changes from the new branch.
306305

307-
![Change environment branch in the environment's settings tab](https://res.cloudinary.com/dza7lstvk/image/upload/v1750170517/Cloud/CleanShot_2025-06-17_at_17.28.25_2x_nfx79a.png)
308-
309306
---
310307

311308
## Import and Export Environment's Database Dump

www/apps/cloud/app/environments/preview/page.mdx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Tabs, TabsList, TabsTrigger, TabsContent, TabsContentWrapper } from "docs-ui"
1+
import { Tabs, TabsList, TabsTrigger, TabsContent, TabsContentWrapper, InlineIcon } from "docs-ui"
2+
import { XMark } from "@medusajs/icons"
23

34
export const metadata = {
45
title: `Preview Environments`,
@@ -149,22 +150,31 @@ While you can manage each preview environment's settings individually, you can a
149150

150151
For example, you can define environment variables that are common to all preview environments.
151152

153+
Shared settings are also useful to specify when preview environments are created for pull requests. For example, you can disable preview environments for pull requests of specific branches and authors.
154+
152155
To manage the shared settings for preview environments:
153156

154-
1. In a [project's dashboard](../../projects/page.mdx#open-project-dashboard), click on the "Settings" tab.
155-
2. Choose the "Previews" tab from the sidebar.
156-
3. In the Previews settings, you can:
157-
- Manage environment variables, as explained in the [Manage Environment Variables](../environment-variables/page.mdx) guide. All preview environments created after making changes will inherit these variables.
158-
- Specify which database to create the preview environment's database from. By default, a new database will be created from the Production environment's database. You can change this to use a different environment's database, such as Staging.
157+
1. In a [project's dashboard](../../projects/page.mdx#open-project-dashboard), click on the **Settings** tab.
158+
2. Choose **Previews** from the sidebar.
159+
3. This opens the shared settings page for both Backend and Storefront. You can change the view by toggling the **Backend** or **Storefront** tabs. It includes the following settings:
160+
- **Environment variables**: Manage environment variables shared across all preview environments, as explained in the [Manage Environment Variables](../environment-variables/page.mdx) guide. All preview environments created after making changes will inherit these variables.
161+
- **Provisioning Rules**: (Backend tab) Define conditions that control when a preview environment is provisioned for a pull request (PR). To add new conditions:
162+
- Click **Add condition**.
163+
- Choose a condition parameter from the first dropdown. It can be **Author** to apply conditions based on who opened the PR, **Branch** to apply conditions on the PR's branch, or **PR title**, **PR description**, and **PR label** to apply conditions on these PR attributes.
164+
- Choose a condition operator from the second dropdown to specify how the condition value matches. It can be **is** for equality matching, **is not** for inequality matching, and **contains** for specifying a value that is contained in the parameter's value.
165+
- Choose a condition value in the last input that is used for the condition matching. For example, enter the name of the author that the PR must have to provision a preview (**Author** **is** **example**), text that must be contained in a PR description (**PR description** **contains** **create preview**), or a branch name that preview environment must not be provisioned for (**Branch** **is not** **docs**)
166+
- To remove an existing or new condition, click the <InlineIcon Icon={XMark} alt="X" /> icon.
167+
- If you add multiple conditions, you can change how the conditions are joined. Choose **and** to match all conditions; choose **or** to match one of the conditions.
168+
- Once you're done, click the **Save** button.
169+
- **Deploy Rules**: Define conditions that control when a provisioned preview environment is deployed. Available fields are **Author** and **Commit message**. Use the same operators and logic options as provisioning rules. Click **Save** to apply changes.
170+
- **Database base branch**: Specify which environment's database to create the preview environment's database from. By default, a new database is created from the Production environment's database. You can change this to use a different environment's database, such as Staging.
159171

160172
<Note>
161173

162174
Making changes to the shared settings will affect all preview environments created after the changes. Existing preview environments will not be affected by the changes.
163175

164176
</Note>
165177

166-
![Previews settings in the project's settings tab](https://res.cloudinary.com/dza7lstvk/image/upload/v1767790182/Cloud/CleanShot_2026-01-07_at_14.49.36_2x_vn8hej.png)
167-
168178
---
169179

170180
## Preview Environment's Database

www/apps/cloud/generated/edit-dates.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export const generatedEditDates = {
1313
"app/update-medusa/page.mdx": "2026-01-08T08:54:50.149Z",
1414
"app/connect-storefront/page.mdx": "2026-01-08T08:50:31.830Z",
1515
"app/environments/environment-variables/page.mdx": "2026-07-14T15:49:50.427Z",
16-
"app/environments/long-lived/page.mdx": "2026-06-18T13:40:26.814Z",
17-
"app/environments/preview/page.mdx": "2026-05-20T13:20:57.494Z",
16+
"app/environments/long-lived/page.mdx": "2026-07-27T15:27:12.712Z",
17+
"app/environments/preview/page.mdx": "2026-07-27T15:27:45.446Z",
1818
"app/faq/page.mdx": "2026-04-14T10:44:08.191Z",
1919
"app/billing/page.mdx": "2026-07-24T15:42:16.652Z",
2020
"app/usage/page.mdx": "2026-04-10T10:22:15.211Z",

0 commit comments

Comments
 (0)