-
Notifications
You must be signed in to change notification settings - Fork 29
26 lines (26 loc) · 964 Bytes
/
build.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
name: Build OpenAPI docs
on:
push:
pull_request:
types: [opened, reopened, sychronize]
jobs:
docs-build:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 14.x
# Comes with npm 6. For newer Node, encountered: https://github.com/npm/cli/issues/3359
- run: npm install -g @redocly/openapi-cli && npm install -g redoc-cli
- run: npm install -g gh-openapi-docs
- name: Check out repository code
uses: actions/checkout@v4
- run: gh-openapi-docs
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: .
target-folder: ${{ github.ref == 'refs/heads/main' && 'docs/index.html' || '' }} # Deploy to docs/index.html only if on main
clean: ${{ github.ref == 'refs/heads/main' }} # Clean only if on the main branch