-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (65 loc) · 1.85 KB
/
Copy pathpage.yml
File metadata and controls
78 lines (65 loc) · 1.85 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
78
name: Deploy GitHub Pages
on:
push:
branches:
- main
jobs:
generate-openapi-spec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Install dependencies
run: |
npm install -g @typespec/compiler
tsp install
- name: Style check
run: |
tsp format --check "**/*.tsp"
- name: Compile
run: |
tsp compile .
- name: Upload openapi.yaml
uses: actions/upload-artifact@v4
with:
name: spec-file
path: tsp-output/schema/openapi.1.0.0.yaml
- name: Upload swagger-ui
uses: actions/upload-artifact@v4
with:
name: swagger-ui
path: swagger-ui.html
deploy:
needs: generate-openapi-spec
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download openapi.yaml
uses: actions/download-artifact@v4
with:
name: spec-file
- name: Download swagger-ui.html
uses: actions/download-artifact@v4
with:
name: swagger-ui
- uses: actions/setup-node@v3
- name: Install dependencies
run: |
npm i -g @redocly/cli@latest
- name: Generate Redocly and Swagger UI
run: |
mkdir -p ./redocly-ui
redocly build-docs openapi.1.0.0.yaml --output ./redocly-ui/redocly.html
mkdir -p ./publish
cp openapi.1.0.0.yaml ./publish/
cp redocly-ui/redocly.html ./publish/
cp swagger-ui.html ./publish/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./publish