Gatsby is a blazing fast modern site generator for React. This guide explains how to deploy your Gatsby website to Clodui.
Create a website by following the steps explained here
Make sure SPA mode is enabled for your Clodui website as described in settings section
Open the terminal and navigate to your Gatsby website directory. Add Clodui CLI to your project by running following command.
npm install @clodui/cli --save-dev
Add a new NPM script to your package.json
with the name deploy
like below
"scripts": {
"deploy": "clodui deploy create --website-id <Clodui website id> --source-dir ./public",
....
}
Note: update --source-dir
argument accordingly if Gatsby website is generated not under public
directory.
Clodui CLI command requires credentials. So set CLODUI_USERNAME
and CLODUI_PASSWORD
environment variables before running NPM script deploy
. Like below
CLODUI_USERNAME=<Username> CLODUI_PASSWORD=<Password> npm run deploy
We use cookies to offer you a better experience and analyze site traffic. By continuing to use this website, you consent to the use of our cookies.