-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (40 loc) · 1.16 KB
/
deploy-openapi.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
name: Publish OpenAPI
on:
push:
branches:
- master
paths:
- '.github/workflows/deploy-openapi.yml'
- 'src/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
workflow_dispatch:
jobs:
job:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@master
with:
dotnet-version: 8.x.x
- name: Build
run: dotnet build src/P3D.Legacy.Server/P3D.Legacy.Server.csproj -c Release
shell: pwsh
- name: Restore tools
run: dotnet tool restore
shell: pwsh
- name: Generate OpenAPI spec
run: dotnet swagger tofile --output ./openapi.json ./src/P3D.Legacy.Server/bin/Release/net8.0/P3D.Legacy.Server.dll v1
shell: pwsh
- name: Generate Swagger UI
uses: Legion2/swagger-ui-action@v1
with:
output: swagger-ui
spec-file: ./openapi.json
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: swagger-ui