Skip to content

Commit 17f2676

Browse files
authored
Update api-docs.yml
Signed-off-by: pentreathm <pentreathm@decentraland.org>
1 parent 404362c commit 17f2676

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

.github/workflows/api-docs.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,36 @@ on:
99
- master
1010

1111
jobs:
12-
build:
13-
uses: decentraland/platform-actions/.github/workflows/apps-docs.yml@main
14-
with:
15-
api-spec-file: docs/openapi.yaml
16-
api-spec-name: places
17-
output-bundle-file: docs/openapi.yaml
18-
secrets: inherit
12+
build-and-publish:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITBOOK_TOKEN: ${{ secrets.GITBOOK_TOKEN }}
16+
GITBOOK_ORGANIZATION_ID: ${{ secrets.GITBOOK_ORGANIZATION_ID }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Validate OpenAPI specification
32+
run: npx @redocly/cli@latest lint docs/openapi.yaml
33+
34+
- name: Bundle OpenAPI specification
35+
run: npx @redocly/cli@latest bundle docs/openapi.yaml --output docs/openapi-bundled.yaml --ext yaml --dereferenced
36+
37+
- name: Publish to GitBook
38+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
39+
run: |
40+
npm install -g @gitbook/cli
41+
gitbook openapi publish \
42+
--spec "places" \
43+
--organization "$GITBOOK_ORGANIZATION_ID" \
44+
"docs/openapi-bundled.yaml"

0 commit comments

Comments
 (0)