Missing information on working with environments

For Workers & Pages, what is the name of the domain?

N/A

What is the issue or error you’re encountering

There is no information on the docs site for working with environments whilst using the GitHub integration

What steps have you taken to resolve the issue?

I’ve read the docs but they seemingly all skip over all usage except those deploying manually with the CLI.

These are defined under [env.name] keys, such as [env.staging] which you can then preview or deploy with the -e / --env flag in the wrangler commands like npx wrangler deploy --env staging.

Alternatively, you can specify per-environment values in the wrangler.toml / wrangler.json file and provide an environment value via the env flag when developing locally like so wrangler dev --env=local.

I’m using the GitHub integration which automatically deploys on commit – how am I meant to be configuring environments? I would assumed that production would be the default but apparently it isn’t.

What are the steps to reproduce the issue?

vars = { WORKER_ENV = "development" }

[env.production]
vars = { WORKER_ENV = "production" }

I should add that wrangler pages, for some reason, doesn’t support using --env so the variables cannot be reversed as I’d have no way to opt-in to that, seemingly. Another thing which the docs don’t cover.