-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpush_mintlify.yml
More file actions
77 lines (63 loc) · 2.46 KB
/
push_mintlify.yml
File metadata and controls
77 lines (63 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build SDKs on branch push
on:
push:
# Set this to the branch of the repository that the `main` Stainless branch
# of your project gets its OpenAPI spec from. This is usually the default
# branch of your repository.
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
# Stainless project name.
STAINLESS_PROJECT: YOUR_PROJECT
# Path to your OpenAPI spec.
OAS_PATH: YOUR_OAS_PATH
# Path to your Stainless config. Optional; only provide this if you prefer
# to maintain the ground truth Stainless config in your own repo.
CONFIG_PATH: YOUR_CONFIG_PATH
# The commit message to use for the SDK builds. Use a commit message in the
# conventional commits format: https://www.conventionalcommits.org/en/v1.0.0/
COMMIT_MESSAGE: "feat(api): update api"
# When to fail the job based on build conclusion.
# Options: "never" | "note" | "warning" | "error" | "fatal".
FAIL_ON: error
# Name of your Mintlify GitHub repo, e.g. `stainless-api/docs`.
MINTLIFY_DOCS_REPO: YOUR_MINTLIFY_DOCS_REPO
# Email associated with the GitHub token, for committing to the Mintlify repo.
GITHUB_TOKEN_EMAIL: YOUR_EMAIL
# Name associated with the GitHub token, for committing to the Mintlify repo.
GITHUB_TOKEN_NAME: YOUR_NAME
# In your repo secrets, configure:
# - API_TOKEN_GITHUB: a GitHub personal access token with permissions to
# write to the Mintlify repo
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Run build
id: build
uses: stainless-api/upload-openapi-spec-action/build@v1
with:
project: ${{ env.STAINLESS_PROJECT }}
oas_path: ${{ env.OAS_PATH }}
config_path: ${{ env.CONFIG_PATH }}
commit_message: ${{ env.COMMIT_MESSAGE }}
fail_on: ${{ env.FAIL_ON }}
- name: Push spec to Mintlify
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: ${{ steps.build.outputs.documented_spec_path }}
destination_repo: ${{ env.MINTLIFY_DOCS_REPO }}
destination_folder: openapi-specs
user_email: ${{ env.GITHUB_TOKEN_EMAIL }}
user_name: ${{ env.GITHUB_TOKEN_NAME }}
commit_message: Auto-updates from Stainless