The Demo Store can be deployed wherever you prefer. Please find here below the details about how to do it using some of the most common platforms. If you tested different ways to deploy it or used other services, please join the discussion and share the steps with the community!
Configuring GitHub workflows is straightforward. We already created one that can be triggered manually. To do that:
-
Review the
gh-pages.yml
file by updating the environment variables. You need and create two secrets in your repository. -
Now you should be able to run the workflow. This will build your Demo Store statically and deploy the artifact to GitHub Pages.
ℹ️ Feel free to update the workflow according to your needs. You can trigger the deploy with every
git push
or change the "Deploy" step (e.g. by publishing the artifact somewhere else such as AWS S3, Netlify, etc.).
⚠️ Make sure to stick to GitHub's guideline about the prohibited-uses: «GitHub Pages is not intended for or allowed to be used as a free web-hosting service to run your online business, ecommerce site, or any other website that is primarily directed at either facilitating commercial transactions [...]» ( )
Inside the project root you can find two files: netlify.ssg.toml
(for static site generation) and netlify.ssr.toml
(for server-side rendering)
-
Rename one of these into
netlify.toml
and update the[build.environment]
section with the environment variables as you need. -
From your Netlify dashboard, click on "Add new site -> Import an existing project" and then select the correct repository.
-
At this point, you should have some fields already filled in. Click on "Show advanced" and add the missing environment variables:
SITE_URL
,NEXT_PUBLIC_CL_CLIENT_ID
, andNEXT_PUBLIC_CL_ENDPOINT
. Please note that you cannot know yet which will be theSITE_URL
until Netlify creates a random site name after the first deployment. -
Click on "Deploy site". We suggest stopping the first auto-deploy by clicking on "Cancel deploy" because this way you can update the
SITE_URL
with the correct information first. You can also speed up the deployment by disabling the form detection (the Demo Store project doesn't include forms managed by Netlify). -
Trigger a new deploy and enjoy your store up and running. 🚀
From your Vercel dashboard:
-
Click on "Add New... -> Project"
-
Select the correct repository.
-
Fill in all the required information as per the image below:
-
Click on "Deploy" and in less than 2 minutes your store will be ready to go.
ℹ️ You need to add
ENABLE_EXPERIMENTAL_COREPACK=1
as an environment variable since the installed npm version used by Vercel does not runpostinstall
due to a bug.
If you prefer to go the SSG way you just need to apply the following changes to the information above:
- Framework preset:
Other
- Build command:
npm run export
- Output directory:
demo-store-core/packages/website/out
- Environment variable:
NEXT_PUBLIC_DATA_FETCHING=ssg