Skip to content

Commit ea0be9f

Browse files
committed
action to sync openapi spec
1 parent 905080b commit ea0be9f

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Sync OpenAPI to docs repo
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'openapi.yaml'
8+
9+
jobs:
10+
sync:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout openapi-spec
15+
uses: actions/checkout@v4
16+
17+
- name: Set up SSH for deploy key
18+
run: |
19+
mkdir -p ~/.ssh
20+
echo "${{ secrets.DOCS_DEPLOY_KEY }}" > ~/.ssh/id_ed25519
21+
chmod 600 ~/.ssh/id_ed25519
22+
ssh-keyscan github.com >> ~/.ssh/known_hosts
23+
24+
- name: Clone docs repo
25+
run: |
26+
git clone git@github.com:togethercomputer/mintlify-docs.git
27+
cp openapi.yaml mintlify-docs/openapi.yaml
28+
29+
- name: Commit and push update
30+
run: |
31+
cd mintlify-docs
32+
git config user.name "github-actions[bot]"
33+
git config user.email "github-actions[bot]@users.noreply.github.com"
34+
35+
git add openapi.yaml
36+
git commit -m "Sync OpenAPI spec from openapi-spec repo"
37+
git push origin main

0 commit comments

Comments
 (0)