-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (51 loc) · 1.72 KB
/
openapi-deploy.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
name: OpenAPI Deploy
on:
push:
branches:
- master
paths:
- "api-*/openapi.yaml"
- ".github/workflows/openapi-deploy.yml"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
api: [admin, internal, public, private]
name: build docs for api-${{ matrix.api }}
steps:
- uses: actions/checkout@v2
- name: Generate OpenAPI UI
uses: Legion2/swagger-ui-action@v1
with:
output: dist/api-${{ matrix.api }}
spec-file: api-${{ matrix.api }}/openapi.yaml
- name: Upload api-${{ matrix.api }} as artifact
uses: actions/upload-artifact@v2
with:
name: api-${{ matrix.api }}
path: dist/api-${{ matrix.api }}
deploy:
runs-on: ubuntu-latest
needs: [build]
steps:
- run: mkdir dist/
- uses: actions/download-artifact@v2
with:
path: dist/
- run: ls -R
working-directory: dist/
- name: Create index.html
run: |
echo '<h2>Accesso OpenAPI</h2>' >> dist/index.html
echo '<ul>' >> dist/index.html
echo ' <li><a href="/backend/api-internal/index.html">api-internal</a></li>' >> dist/index.html
echo ' <li><a href="/backend/api-private/index.html">api-private</a></li>' >> dist/index.html
echo ' <li><a href="/backend/api-public/index.html">api-public</a></li>' >> dist/index.html
echo ' <li><a href="/backend/api-admin/index.html">api-admin</a></li>' >> dist/index.html
echo '</ul>' >> dist/index.html
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist/