toolbox · tool
Wrangler
Cloudflare's CLI, used to deploy the games site from CI.
Install
npm install --save-dev wranglernpx wrangler --versionWhat it is
Wrangler is Cloudflare’s command-line tool for Workers and Pages. We use it for one job: uploading the migrated games site to the existing Direct Uploads project.
How it works
- It authenticates with a Cloudflare API token and account id.
wrangler pages deploy <dir> --project-name <name>uploads a folder as a new deployment.- In CI we call it through
cloudflare/wrangler-action@v3instead of installing it by hand.
In this project
npx wrangler pages deploy sites/games/dist --project-name=unni-games
That exact command runs inside the Deploy unni-games GitHub workflow.
Gotchas
- The Pages project must already exist. Wrangler deploys to it; it does not set up the GitHub integration.
- The token needs Pages:Edit. Store it as a GitHub secret, never in the repo.
- A deploy is a new deployment, not a merge: the previous one stays available for rollback.