How to use cloud flare wrangler to upload assets to pages production environment

32 Views Asked by At

The following command didn't upload my assets as production on the pages site. It was always uploaded as preview.

There is no wrangler.toml in my project

npx wrangler pages deploy --project-name=$project_name ./dist/apps/player2 

The following didn't work:

  • using --env=production
  • using --branch=production
1

There are 1 best solutions below

0
On

What worked is creating the project with production branch set as the same branch I was going to upload later.

npx wrangler pages project create $project_name --production-branch=$release_branch

npx wrangler pages deploy --project-name=$project_name ./dist/apps/player2 --branch=$release_branch