GitHub Actions
Push your OpenAPI spec to Octri from CI with the Octri GitHub Action. Every merge that changes the spec republishes your docs, MCP server and changelog, and can build your SDKs in the same run.
The action is OctriDev/octri-action. It runs the Octri CLI, waits for the spec to finish processing, and fails the step if it doesn't.
Set it up
- Create an API key
Create an Octri API key under Settings, API keys, and store it in your repository as the
OCTRI_API_KEYsecret. See API keys. - Add the project ID
Store the project's ID as the
OCTRI_PROJECT_IDrepository variable. The project's GitHub Actions card on the Integrations page shows it, and so doesoctri projects list. - Add the workflow
Commit this as
.github/workflows/octri.yml, with your spec's path:yamlname: Publish API on: push: branches: [main] paths: [openapi.yaml] jobs: octri: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: OctriDev/octri-action@v1 with: api-key: ${{ secrets.OCTRI_API_KEY }} project-id: ${{ vars.OCTRI_PROJECT_ID }} spec: openapi.yaml
The paths filter keeps the workflow from running when nothing in the spec changed.
Inputs
api-keystringrequiredAn Octri API key. Pass it from a secret, never as plain text.
project-idstringrequiredThe project the spec belongs to.
specpathrequiredThe spec's path from the repository root, YAML or JSON.
build-sdksbooleanAlso build the SDKs once the spec is in. The step fails if any language fails. See builds.
cli-versionstringThe @octri/cli version to run. Pin it to keep a CLI release from changing your pipeline unannounced.
Other CI systems
The action is a thin wrapper around two CLI commands, octri specs push and octri sdk build, so any CI that runs Node can do the same. See CI setup.
Related
To keep the spec in a repository that Octri watches itself, with no workflow to maintain, use GitHub sync instead.