Skip to content

Commit c50acf0

Browse files
feat: add mintlify docs publish job (ENG-841) (#374)
1 parent 3205b3f commit c50acf0

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.json]
15+
trim_trailing_whitespace = false

.vscode/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"[json]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
},
5+
"[jsonc]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[markdown]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[yaml]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[toml]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode"
16+
},
17+
"editor.codeActionsOnSave": {
18+
"source.fixAll.eslint": "explicit"
19+
},
20+
"eslint.format.enable": true
21+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
parameters:
2+
schema_dir:
3+
description: Directory to store schemas between jobs
4+
type: string
5+
default: "/tmp/schemas"
6+
docs_repo:
7+
description: Repository containing Mintlify docs
8+
type: string
9+
default: "docs-v2"
10+
executor:
11+
description: Executor to run the command on
12+
type: executor
13+
default: node-executor
14+
executor: << parameters.executor >>
15+
steps:
16+
- checkout_clone
17+
- attach_workspace:
18+
at: ~/voiceflow
19+
- install_node_modules
20+
- openapi_restore_schemas:
21+
attach_workspace: true
22+
from: "<< parameters.schema_dir >>"
23+
to: ~/voiceflow
24+
- clone_repo:
25+
step_name: Clone Mintlify docs repository
26+
github_username: GITHUB_USERNAME
27+
github_token: GITHUB_TOKEN
28+
github_repo_name: "<< parameters.docs_repo >>"
29+
path_to_clone: ~/docs
30+
- run:
31+
name: Commit public OpenAPI schemas to Mintlify docs repo
32+
command: |
33+
yarn schema:extract:public
34+
35+
# copy schemas to docs repo
36+
cd apps
37+
cp -v --parents */openapi.public.json ~/docs/specs
38+
39+
# within the docs repo
40+
cd ~/docs
41+
git config --global user.email "serviceaccount@voiceflow.com"
42+
git config --global user.name "Voiceflow"
43+
git add specs/*/openapi.public.json
44+
git diff-index --quiet HEAD || git commit -m "feat: evolve ${CIRCLE_PROJECT_REPONAME} schemas"
45+
git pull --rebase
46+
git push

0 commit comments

Comments
 (0)