-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (43 loc) · 1.48 KB
/
Copy pathapi-documentation.yml
File metadata and controls
54 lines (43 loc) · 1.48 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
name: Build API Documentation and Deploy to GitHub Pages
on:
push:
branches:
- 'main'
jobs:
build-spec:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
# 2. Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
with:
node-version: '20'
# 3. Install Redocly CLI
- name: Install Redocly CLI
run: npm install -g @redocly/cli@2.5.0
# 4. Validate OpenAPI spec
- name: Validate OpenAPI Spec
run: redocly lint api-docs/gogolf-openapi-spec.yml
# 5. Build output directory
- name: Create build directory
run: mkdir -p public
# 6. Copy spec
- name: Copy spec
run: mkdir -p public/spec && cp api-docs/gogolf-openapi-spec.yml public/gogolf-openapi-spec.yml
# 7. Copy landing page
- name: Copy landing page
run: cp api-docs/index.html public/index.html
# 8. Upload static files as artifact
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b #v4.0.0
with:
path: public/
# 9. Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5