docs: updates for storefront in cloud (#14491)
* docs: updates for storefront in cloud * comment-out pnpm * fix broken link * npm prerequisites * Update www/apps/cloud/app/storefront/page.mdx Co-authored-by: Stevche Radevski <sradevski@live.com> * remove global cdn --------- Co-authored-by: Stevche Radevski <sradevski@live.com>
This commit is contained in:
co-authored by
Stevche Radevski
parent
bb599a26de
commit
baaee11114
@@ -11,12 +11,14 @@ In this guide, you'll learn about deployments in Cloud, how they're created, and
|
||||
|
||||
## Deployments Overview
|
||||
|
||||
Each [environment](../environments/page.mdx) has at least one deployment, which is publicly accessible at the [environment's URL](./access/page.mdx#find-environments-url).
|
||||
Each [environment](../environments/page.mdx) has at least one deployment, which is publicly accessible at the [environment's URL](./access/page.mdx#find-backend-and-admins-url).
|
||||
|
||||
A deployment is created from the latest source code of an [environment](../environments/page.mdx)'s branch. An environment can have only one live deployment at a time.
|
||||
|
||||
The latest deployment of an environment is the live version of that environment, unless you [redeploy a previous deployment](#redeploy-a-deployment).
|
||||
|
||||
If you deployed both the Medusa backend and storefront in an environment, each deployment refers to the backend and storefront. The deployment will also show the status of both the backend and storefront.
|
||||
|
||||
---
|
||||
|
||||
## How are Deployments Created?
|
||||
@@ -29,6 +31,8 @@ For short-lived preview environments, Medusa creates a new environment and deplo
|
||||
|
||||
## Build Process for Deployments
|
||||
|
||||
### Medusa Application Only
|
||||
|
||||
Before deploying your application on Cloud, Medusa runs the `build` script defined in your project's `package.json` file, which must run the `medusa build` command, among other build steps you may have.
|
||||
|
||||
For example, your `build` script may look like this:
|
||||
@@ -47,9 +51,17 @@ You can replace `npm run other-build-steps` with the appropriate command for you
|
||||
|
||||
</Note>
|
||||
|
||||
### What Gets Deployed?
|
||||
### Medusa Application with Storefront
|
||||
|
||||
Medusa deploys the contents of the `.medusa/server` directory created by the [build process](!docs!/learn/build). It includes the compiled JavaScript files in your project, the production build of the admin dashboard, and other necessary files to run your Medusa application in production.
|
||||
If you're deploying both a Medusa application and a storefront on Cloud, Medusa will run the:
|
||||
|
||||
1. The `build` command defined in the backend's `package.json` file, which must run the `medusa build` command.
|
||||
2. The build command relevant to the storefront, depending on the framework you're using. For example, if you're using Next.js for your storefront, Medusa will run the `next build` command in the storefront's directory.
|
||||
- Medusa currently doesn't support custom build scripts for storefronts.
|
||||
|
||||
### What Gets Deployed in the Medusa Application?
|
||||
|
||||
Medusa deploys the contents of the `.medusa/server` directory of the Medusa application. This directory is created by the [build process](!docs!/learn/build). It includes the compiled JavaScript files in your project, the production build of the admin dashboard, and other necessary files to run your Medusa application in production.
|
||||
|
||||
<Note>
|
||||
|
||||
@@ -94,17 +106,10 @@ You can find the deployments for an environment in the project and environment d
|
||||
For example, to find the deployments for the Production environment:
|
||||
|
||||
1. [Go to its project's dashboard](../projects/page.mdx#open-project-dashboard).
|
||||
2. You can go to the latest Production deployment's details by clicking the "Latest Deployment" link in the Production environment card.
|
||||
2. Click on the "Production" environment card.
|
||||
3. You'll find the deployments in the "Deployments" table on the environment's dashboard.
|
||||
|
||||

|
||||
|
||||
3. To find a list of all deployments, click on the "Production" environment card to open the environment's dashboard.
|
||||
- The "Latest update" card shows details about the latest deployment.
|
||||
- The "Deployments" card shows the list of all previous deployments.
|
||||
|
||||

|
||||
|
||||
The last step applies to all environments in your project, including custom environments (like Staging) and preview environments.
|
||||

|
||||
|
||||
---
|
||||
|
||||
@@ -115,22 +120,19 @@ You'll often need to check a deployment's details, such as its status, commit in
|
||||
To view a deployment's details:
|
||||
|
||||
1. [Go to its project's dashboard](../projects/page.mdx#open-project-dashboard).
|
||||
2. If you're looking for the latest deployment:
|
||||
- Click the "Latest Deployment" link in its environment's card.
|
||||
3. If you're looking for an older deployment:
|
||||
- Click on its environment's card to open its dashboard.
|
||||
- In the "Deployments" card, click on the deployment you want to view.
|
||||
2. Click on the "Deployments" tab.
|
||||
3. Click on the deployment in the deployments table.
|
||||
|
||||
This will open the deployment's details page, where you can also see the deployment's commit at the top of the page.
|
||||
|
||||
On the deployment details page, you'll find:
|
||||
|
||||

|
||||

|
||||
|
||||
1. **Commit**: The commit that the deployment was created from. This is the page's title.
|
||||
2. **Status**: The current [status](#deployment-statuses-and-lifecycle) of the deployment. For example, "Live" or "Build Failed". You can see it next to the "Redeploy" button.
|
||||
3. **Author**: The GitHub user who pushed the commit that created the deployment. You can see the user name when you hover over the user's avatar.
|
||||
4. **Build Logs**: This section shows the logs from the build process. They are useful to understand why a deployment failed. Learn more in the [Logs](../logs/page.mdx) guide.
|
||||
4. **Activity**: This section shows the build logs for the backend and storefront (if applicable). They are useful to understand why a deployment failed. Learn more in the [Logs](../logs/page.mdx) guide.
|
||||
|
||||
### Switch Between Deployments
|
||||
|
||||
@@ -141,7 +143,7 @@ To switch to a different deployment:
|
||||
1. Click on the deployment's commit at the top of the Cloud dashboard, next to the environment's name.
|
||||
2. Choose the deployment you want to switch to from the dropdown.
|
||||
|
||||

|
||||

|
||||
|
||||
This will change the view to the selected deployment and you'll see its details and logs.
|
||||
|
||||
@@ -244,7 +246,7 @@ If a deployment is stuck at a status like "Building" or "Deploying" for a long t
|
||||
|
||||
## Access Live Deployment
|
||||
|
||||
Once a deployment's status is "Live", you can access its Medusa Admin and send requests to its API routes.
|
||||
Once a deployment's status is "Live", you can access its Medusa Admin, send requests to its API routes, and access its storefront (if applicable).
|
||||
|
||||
Learn more in the [Access Live Deployment](./access/page.mdx) guide.
|
||||
|
||||
@@ -283,7 +285,7 @@ To redeploy a deployment:
|
||||
1. [Go to the deployment's details page](#find-deployment-details).
|
||||
2. Click the "Redeploy" button at the top right of the page.
|
||||
|
||||

|
||||

|
||||
|
||||
This will trigger the redeployment process for the selected deployment. The deployment will go through [the same lifecycle](#deployment-statuses-and-lifecycle) as a new deployment.
|
||||
|
||||
@@ -308,7 +310,7 @@ To change the deployment rules for an environment:
|
||||
3. Click on the "Deployment rules" tab in the sidebar.
|
||||
4. You'll find a `branch` rule. You can edit it by clicking the <InlineIcon Icon={EllipsisHorizontal} alt="three-dots" /> icon and choosing "Edit" from the dropdown.
|
||||
|
||||

|
||||

|
||||
|
||||
5. In the side window that opens, you can change the branch that the environment is connected to. For example, you can change it from `main` to `staging` to create a new deployment every time you push a commit to the `staging` branch.
|
||||
6. Click "Save" to apply the changes.
|
||||
|
||||
Reference in New Issue
Block a user