-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
170 lines (144 loc) · 5.02 KB
/
generate-references.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Generate Automated Documentation (v1)
on:
workflow_dispatch:
inputs:
referenceName:
description: 'Reference to Generate. Use either `all` to generate all references, `api` to generate the API reference, or `ui` to generate UI reference.'
required: false
default: 'all'
release:
types: [published]
jobs:
api:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event.inputs.referenceName == 'all' || github.event.inputs.referenceName == 'api' }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.REFERENCE_PAT }}
fetch-depth: 0
ref: "v1.x"
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "16.10.0"
cache: "yarn"
- name: Install dependencies
uses: ./.github/actions/cache-deps
with:
extension: reference
- name: Build Packages
run: yarn build
- name: Generate API Reference
run: yarn openapi:generate
- name: Install and Build docs-util dependencies
run: yarn && yarn build
working-directory: docs-util
- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore(docs): Generated API Reference"
base: "v1.x"
title: "chore(docs): Updated API Reference"
labels: "type: chore"
add-paths: www/apps/api-reference/specs
branch: "docs/generate-api-ref"
branch-suffix: "timestamp"
api-v2:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event.inputs.referenceName == 'all' || github.event.inputs.referenceName == 'api' }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.REFERENCE_PAT }}
fetch-depth: 0
ref: "v1.x"
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "16.10.0"
cache: "yarn"
- name: Install dependencies
uses: ./.github/actions/cache-deps
with:
extension: reference
- name: Build Packages
run: yarn build
- name: Generate API Reference (v2)
run: yarn openapi:generate --v2
- name: Install and Build docs-util dependencies
run: yarn && yarn build
working-directory: docs-util
- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore(docs): Generated API Reference (v2)"
base: "v1.x"
title: "chore(docs): Updated API Reference (v2)"
labels: "type: chore"
add-paths: www/apps/api-reference/specs
branch: "docs/generate-api-ref"
branch-suffix: "timestamp"
ui:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event.inputs.referenceName == 'all' || github.event.inputs.referenceName == 'ui' }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.REFERENCE_PAT }}
fetch-depth: 0
ref: "v1.x"
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "16.10.0"
cache: "yarn"
- name: Install dependencies
uses: ./.github/actions/cache-deps
with:
extension: reference
- name: Build Packages
run: yarn build
- name: Install Workspace dependencies
run: yarn install
working-directory: docs-util
- name: Build Workspace dependencies
run: yarn build
working-directory: docs-util
- name: Generate UI Specs
run: yarn generate:ui
working-directory: docs-util/packages/react-docs-generator
- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore(docs): Generated UI Reference"
base: "v1.x"
title: "chore(docs): Updated UI Reference"
labels: "type: chore"
add-paths: www/apps/ui/src/specs
branch: "docs/generate-ui-ref"
branch-suffix: "timestamp"