Skip to content

Commit 2aa18b6

Browse files
committed
docs(studio): working with staging
1 parent 7b16de3 commit 2aa18b6

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

docs/content/docs/9.studio/2.setup.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,72 @@ export default defineNuxtConfig({
129129
})
130130
```
131131

132+
## Working with Staging/Preview Branches
133+
134+
By default, Studio commits changes to the branch specified in your configuration (typically `main`). However, you can configure Studio to work with a staging or preview branch instead.
135+
136+
This is useful when you want to review changes on a preview environment before merging to production. You can currently handle pull requests manually from GitHub, but automatic PR creation is included in our roadmap and will be implemented in a future release.
137+
138+
::prose-steps
139+
### Configure
140+
141+
Update your `nuxt.config.ts` to target your staging branch.
142+
143+
:::tip
144+
You can use environment variables to manage multiple branches for different environments.
145+
:::
146+
147+
```ts [nuxt.config.ts]
148+
export default defineNuxtConfig({
149+
studio: {
150+
repository: {
151+
owner: 'your-username',
152+
repo: 'your-repo',
153+
branch: PROCESS.ENV.STUDIO_GITHUB_BRANCH_NAME, // Target your staging branch instead of main
154+
}
155+
}
156+
})
157+
```
158+
159+
### Deploy
160+
161+
Configure your hosting platform to deploy the staging branch to a preview URL (e.g., `staging.yourdomain.com`).
162+
163+
### Create a Separate GitHub OAuth App
164+
165+
Create a new OAuth App specifically for your staging environment:
166+
167+
- **Application name**: Your App Name (Staging)
168+
- **Homepage URL**: `https://staging.yourdomain.com`
169+
- **Authorization callback URL**: `https://staging.yourdomain.com`
170+
171+
### Set Environment Variables
172+
173+
Configure your staging deployment with the staging OAuth credentials and your br
174+
175+
```bash [.env.staging]
176+
STUDIO_GITHUB_CLIENT_ID=<your_staging_github_client_id>
177+
STUDIO_GITHUB_CLIENT_SECRET=<your_staging_github_client_secret>
178+
STUDIO_GITHUB_BRANCH_NAME=<your_staging_branch_name>
179+
```
180+
181+
### Access Studio on Staging
182+
183+
Navigate to `https://staging.yourdomain.com/_studio` to edit content. All commits will be pushed to your configured staging branch.
184+
185+
### Merging to Production
186+
187+
Once you're satisfied with changes on your staging branch, create a pull request from your staging branch to your main branch on GitHub to deploy to production.
188+
189+
:::note
190+
**Pull Request Automation Coming Soon**
191+
192+
:br
193+
194+
Automatic pull request creation from Studio is planned for a future release. For now, you'll need to manually create PRs on GitHub to merge staging changes into your main branch.
195+
:::
196+
::
197+
132198
### Accessing Studio
133199

134200
After deployment, access the Studio interface by navigating to your configured route (default: `/_studio`):

0 commit comments

Comments
 (0)