You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start a local development server with hot-reloading:
69
134
70
-
```bash
71
-
fern generate --docs
72
-
```
135
+
```bash
136
+
fern docs dev
137
+
```
138
+
139
+
Open [http://localhost:3000](http://localhost:3000) to see your docs. Changes to MDX files and `docs.yml` will reload automatically.
140
+
141
+
### 5. Publish
142
+
143
+
When you're ready to go live:
144
+
145
+
```bash
146
+
fern generate --docs
147
+
```
148
+
149
+
This requires a `FERN_TOKEN`. Get yours from the [Fern dashboard](https://dashboard.buildwithfern.com) under **Settings > API keys**.
150
+
151
+
To generate a shareable preview URL without publishing:
152
+
153
+
```bash
154
+
fern generate --docs --preview
155
+
```
156
+
157
+
## CI/CD workflows
158
+
159
+
This template includes three GitHub Actions workflows out of the box:
160
+
161
+
| Workflow | Trigger | What it does |
162
+
|----------|---------|--------------|
163
+
|`check.yml`| Every PR and push to `main`| Runs `fern check` to validate your API spec |
164
+
|`preview-docs.yml`| Every PR | Generates a preview URL and posts it as a PR comment |
165
+
|`publish-docs.yml`| Push to `main` (after first build) | Publishes your docs to production |
166
+
167
+
### Setting up CI
168
+
169
+
Add your `FERN_TOKEN` as a repository secret:
170
+
171
+
1. Go to **Settings > Secrets and variables > Actions** in your GitHub repository.
172
+
2. Click **New repository secret**.
173
+
3. Name it `FERN_TOKEN` and paste your token value.
174
+
175
+
The `check.yml` workflow works without a token; only preview and publish require it.
73
176
74
177
## Customize your docs
75
178
76
-
Once you're up and running, you can tailor your docs site to match your brand and product:
179
+
Once you're up and running, tailor your docs to match your brand and product:
77
180
78
181
-**[Brand your docs](https://buildwithfern.com/learn/docs/configuration/site-level-settings)** — Set custom colors, logo, favicon, and fonts in `docs.yml`
79
182
-**[Add an API reference](https://buildwithfern.com/learn/docs/api-references/generate-api-ref)** — Auto-generate interactive API docs from your OpenAPI spec
@@ -82,6 +185,23 @@ Once you're up and running, you can tailor your docs site to match your brand an
82
185
-**[Configure analytics](https://buildwithfern.com/learn/docs/integrations/overview)** — Integrate with PostHog, Segment, Google Tag Manager, and others
0 commit comments