Repository navigation
Commit dec5826
authored
Allow Publish Docs to be run manually (#1289)
## Summary
Adds a manual trigger (`workflow_dispatch`) to **Publish Docs**, so docs.vapi.ai can be republished from the Actions tab or the CLI without merging a PR.
## Why
The nightly `update-openapi` job auto-merges its spec PR with the built-in `GITHUB_TOKEN`. GitHub doesn't start other workflows from events made with that token, so **Publish Docs never runs for spec updates**. New API fields therefore don't reach the live API reference until someone merges an unrelated docs PR.
Example: voice simulation latency expectations shipped on Oct 3. The spec updates that added the fields merged in #1284 (Oct 3) and #1286 (Oct 6), but the last publish ran on Oct 2, so the live Create and Update Scenario pages still don't show `latencyExpectations`.
## Change
Two lines in `.github/workflows/publish-docs.yml`:
- add `workflow_dispatch:` under `on:`;
- widen the job's `if:` guard to accept `workflow_dispatch` as well as `push`. Without this, a manual run would show as skipped. The guard also now checks `github.ref == 'refs/heads/main'` exactly instead of `contains(...)`, so a manual run can't publish another branch.
The publish steps and secrets are unchanged.
## Using it
Once merged, anyone with write access can run **Actions → Publish Docs → Run workflow** on `main`, or:
```bash
gh workflow run publish-docs.yml --repo VapiAI/docs --ref main
```
Merging this PR also publishes everything pending on `main`, including the latest API spec.
## Not included
This makes publishing possible on demand but doesn't make it automatic after the nightly spec update. Two options for the docs owners:
- merge the nightly PR with a GitHub App or bot account token instead of `GITHUB_TOKEN`, so the merge triggers Publish Docs;
- or add a `schedule:` to this workflow shortly after the nightly update.
## Testing
`actionlint` v1.7.7 passes with no findings, and the YAML parses with both triggers. A manual trigger can only be exercised once it's on `main`, so the first real test is a manual run after merge.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 07749ba commit dec5826
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments