Added service discovery #179
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |