-
-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (75 loc) · 2.61 KB
/
webapp-update-swagger-dotnet.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: 'WebApp Update Swagger definitions'
on:
workflow_dispatch:
push:
branches: [master]
paths:
- '**.cshtml'
- '**.cs'
- '**.sln'
- '**.cake'
- '**.json'
- '.github/workflows/auto-update-swagger-dotnet.yml'
- 'starsky-tools/build-tools/app-version-update.js'
pull_request:
branches: [ master ]
paths:
- '.github/workflows/auto-update-swagger-dotnet.yml'
- 'documentation/static/openapi/openapi.json'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.300
- name: Cache nuget packages (*nix)
uses: actions/cache@v4
with:
# nuget cache files are stored in `~/.nuget/packages` on Linux/macOS
path: ~/.nuget/packages
key: ${{ runner.os }}-build-netcore-${{ hashFiles('./starsky/starsky/nuget-packages-list.json') }}
restore-keys: |
${{ runner.os }}-build-netcore-
- name: Run With Exit
shell: bash
working-directory: ./starsky/starsky
env:
app__AddSwagger: "true"
app__AddSwaggerExport: "true"
app__AddSwaggerExportExitAfter: "true"
app__SyncOnStartup: "false"
app__thumbnailGenerationIntervalInMinutes: 0
app__EnablePackageTelemetry: "false"
app__useDiskWatcher: "false"
app__GeoFilesSkipDownloadOnStartup: "true"
app__ExiftoolSkipDownloadOnStartup: "true"
run: dotnet run --no-launch-profile
- name: Copy
shell: bash
run: cp starsky/starsky/bin/Debug/net*.0/temp/starsky.json documentation/static/openapi/openapi.json
- name: Generate swagger
shell: bash
working-directory: ./documentation
run: node scripts/openapi.js
- name: Commit changes openapi.json (if push to branch)
uses: EndBug/add-and-commit@v9
if: github.event_name != 'pull_request'
with:
author_name: SwaggerUpdateBot
author_email: [email protected]
message: "[Swagger] Auto commited swagger/openapi list"
add: "documentation/static/openapi/openapi.json"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes docs/api/readme.md (if push to branch)
uses: EndBug/add-and-commit@v9
if: github.event_name != 'pull_request'
with:
author_name: SwaggerUpdateBot
author_email: [email protected]
message: "[Swagger] Auto commited swagger/openapi list"
add: "docs/api/readme.md"
github_token: ${{ secrets.GITHUB_TOKEN }}