Deploy to Cloudflare
ShipAny uses the OpenNext framework, which supports one-click deployment to Cloudflare.
Using the cloudflare branch
When developing a new project with ShipAny, if you want to deploy to Cloudflare Workers, it’s recommended to pull the cloudflare
branch, which supports one-click deployment without additional modifications.
git clone -b cloudflare [email protected]:shipanyai/shipany-template-one.git my-shipany-project
If you have previously pulled the project from the main
branch, you can refer to the deployment process below for necessary modifications to deploy to Cloudflare.
Deployment Process
- Create a
.env.production
file in the project root directory
cp .env.example .env.production
Update the configurations in the .env.production
file with production environment settings.
- Create a
wrangler.toml
file in the project root directory
cp wrangler.toml.example wrangler.toml
Copy the production environment variables configured in .env.production
to the [vars] section in wrangler.toml
, and modify the project name in wrangler.toml
- Deploy to Cloudflare
Run the following command in the project root directory:
npm run cf:deploy
Follow the prompts to enter the project name and branch name (main), connect to your Cloudflare account, and wait for the deployment to complete.
- Go to the Cloudflare console to see your successfully deployed project
- Access the project
You can access the project using the default generated domain. Bind a custom domain to officially launch.