From 90210373970b6ead6da968d579b5de04fb3770b7 Mon Sep 17 00:00:00 2001 From: Caleb Rogers Date: Tue, 13 Dec 2022 16:12:58 +0800 Subject: [PATCH 1/2] docs: use correct publish directory for netlify deploy (#2741) * Use correct publish directory for netlify deploy Netlify automatically sets the Publish directory as "dist," but the netlify admin app's `build` command outputs files to `public`. * Update docs/content/deployments/admin/deploying-on-netlify.md Co-authored-by: Shahed Nasser * Netlify CLI instructions updated to match UI * Update docs/content/deployments/admin/deploying-on-netlify.md * Update docs/content/deployments/admin/deploying-on-netlify.md * Update deploying-on-netlify.md Co-authored-by: Shahed Nasser --- .../deployments/admin/deploying-on-netlify.md | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/content/deployments/admin/deploying-on-netlify.md b/docs/content/deployments/admin/deploying-on-netlify.md index a4e6348a61..2953857ffe 100644 --- a/docs/content/deployments/admin/deploying-on-netlify.md +++ b/docs/content/deployments/admin/deploying-on-netlify.md @@ -100,7 +100,14 @@ After you authorize Netlify to use GitHub, you’ll be asked to pick the reposit ![Choose Repository](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001871/Medusa%20Docs/Netlify/D0r6Q1e_th5uei.png) -In the form that shows, keep all fields the same and click on the “Show advanced” button before the “Deploy site” button. +In the "Basic build settings" section, make sure the fields have the following values: + +- Base directory: (leave empty) +- Build command: yarn build +- Publish directory: public + + +Next, click the “Show advanced” button, which is above the “Deploy site” button. ![Show advanced Button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001884/Medusa%20Docs/Netlify/nUdwRbq_d2kmo6.png) @@ -211,7 +218,20 @@ If you pick the second option, you’ll need to create a personal access token o ##### Last Step: Steps with Default Values -For the rest of the steps, you can keep the default values provided by Netlify and press the “Enter” key on your keyboard for each. +For the rest of the steps, you can keep most of the default values provided by Netlify, except for the following options: + +1. Set build command to `yarn run build` + +``` +? Your build command (hugo build/yarn run build/etc): yarn run build +``` + +2. Set deploy directory to `public` + +``` +? Directory to deploy (blank for current dir): public +``` + #### Set Environment Variables From 6b51dd016835df23cae927fd63de4f181c0cce25 Mon Sep 17 00:00:00 2001 From: Caleb Rogers Date: Tue, 13 Dec 2022 16:16:01 +0800 Subject: [PATCH 2/2] docs: update environment variable used in admin's deploy guides (#2748) * docs: Update netlify deploy readme for clarity It was unlcear why "Gatsby" was mentioned in the env name for the server URL. Also, the code shows precedence given to `MEDUSA_BACKEND_URL` now: ``` __MEDUSA_BACKEND_URL__: JSON.stringify( env.MEDUSA_BACKEND_URL || // Backwards-compat with Gatsby. env.GATSBY_MEDUSA_BACKEND_URL || env.GATSBY_STORE_URL || "" ), ``` Therefore, this should be indicated in the documentation. * Update docs/content/deployments/admin/deploying-on-netlify.md * Update deploying-on-netlify.md Co-authored-by: Shahed Nasser --- docs/content/deployments/admin/deploying-on-netlify.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/content/deployments/admin/deploying-on-netlify.md b/docs/content/deployments/admin/deploying-on-netlify.md index 2953857ffe..2ce0ac4e29 100644 --- a/docs/content/deployments/admin/deploying-on-netlify.md +++ b/docs/content/deployments/admin/deploying-on-netlify.md @@ -246,11 +246,17 @@ If you haven’t deployed your Medusa server yet, you can leave the value blank Run the following command to add the environment variable: ```bash -netlify env:set GATSBY_MEDUSA_BACKEND_URL "" +netlify env:set MEDUSA_BACKEND_URL "" ``` Where `` is the URL of your Medusa server. +:::note + +In previous versions of the admin, the environment variable name was `GATSBY_MEDUSA_BACKEND_URL` or `GATSBY_STORE_URL` instead. The admin remains backwards compatible, so if you've used this an older version you can keep the same environment variables. However, it's highly recommended you change it to `MEDUSA_BACKEND_URL`. + +::: + #### Check deployment status You can check the deployment status of your website by running the following command: