This post/question is a bit of a brainstorm session jotted down.
My setup:
acma.dev → acts as the latest main deployment for testing and previewing (our tester test on this domain)
*.preview.acma.dev → all preview deployments are on this domain
acma.com → our actual production domain.
Currently if we promote a build to staged production that build will be made available on “acma.com-preview.acma.dev” So now we have a produciton build on our .dev domain, mixing up the cookies we have already set for our .dev environment.
(staged) Production builds should be on our .com domain and preview builds should be on our .dev domain to not mixup cookies.
How do other people fix this issue?
I have to idea’s how this potentially could be solved
-
Custom staged-production URL
“acma.com” → production
“staging.acma.com” → staged production
“acma.dev” → preview
“*.preview.acma.dev” → all preview deployments -
Custom environments
Custom environments solve our issue, but the Shared environment variables that we define on our organization level, these apply to all custom environments. Our project has two types—production (staging.acma.com) and preview (staging.acma.dev). Can we link a custom environment or URL to a specific combination of branch and deployment type (preview or production)? This is the option we envision.
“acma.com” → promotion of staging.acma.com
“acma.dev” → latest main branch with preview environment
“staging.acma.com” → latest release/* branch with production environment (like a staged production)
“staging.acma.dev” → latest release/* branch with preview environment
All other branches should create a deployment preview URL with *.preview.acma.dev with preview environment.
I think I am overthinking this how do other people who have 2 different domains solve this?