Deploy your Saleor App to Netlify with Github

MINIMUM SALEOR VERSION 3.5.10
MINIMUM SALEOR CLI VERSION 1.13

This tutorial will guide you through the process of deploying your Saleor App to Netlify, another popular platform, which provides various tools and features for automating web projects. You can read more about Netlify in the Technologies section.

Prerequisites

  1. Install saleor CLI with npm i -g saleor.
  2. Establish your organisation and environment.
  3. Create a Saleor App template. More on that here.
  4. Set up a remote Git repository for your App at GitHub.com. More on that here.

Step 1. Registering to Netlify.

Registering or logging into Netlify is possible through one of the providers listed at their site. For the purpose of this tutorial, let's use GitHub.

Register or log in to Netlify.
Register or log in to Netlify.

Step 2. Creating a project.

Once logged in, you will be redirected to your dashboard. Here, click Add new site and select Import an existing project.

Import existing project.
Import existing project.

Step 3. Connecting to Git provider.

  1. Connect to Git provider.
Connect to Git provider.
Connect to Git provider.
  1. Search and select your app repository from the list. If you don't see the list, click on Configure the Netlify app on GitHub link below and allow all / chosen repositories to be managed by Netlify.
Pick the repository.
Pick the repository.

Step 4. Preparing your App for deployment.

  1. On the next page, change the build command to: npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build
Update build command.
Update build command.

Netlify's build environment does not support pnpm out of the box. So, with this command we will kindly ask Netlify to use npx to install pnpm in the node_modules folder and run the build script with it.

  1. In the Advanced settings, add two new variables:
  • NEXT_PUBLIC_SALEOR_HOST_URL, take the value from .env file of your app
  • NPM_FLAGS, set the value to --legacy-peer-deps.
Add new variables.
Add new variables.
  1. Hit Deploy site.

After a while, you will have your site live, which you can check by clicking Open published deploy button in the dashboard.

Open published dashboard.
Open published dashboard.

You can use the url of your deployed App in the process of i.e. App installation as described in Creating Apps with Saleor CLI.


Help us improve our docs. Edit this page on GitHub