Skip to content

Merge pull request #98 from nightingaleproject/update-lib-version #89

Merge pull request #98 from nightingaleproject/update-lib-version

Merge pull request #98 from nightingaleproject/update-lib-version #89

name: Update Swagger Documentation
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- name: Install Dependencies
run: |
dotnet tool restore
dotnet build
- name: Create Swagger folder
run: |
mkdir -p ./swagger
mkdir -p ./swagger/v1
- name: Run Swagger Doc Generation Scripts
run: |
dotnet swagger "tofile" --output './swagger/v1/swagger.yaml' --yaml './messaging/bin/Debug/net6.0/messaging.dll' v1
dotnet swagger "tofile" --output './swagger/v1/swagger.json' './messaging/bin/Debug/net6.0/messaging.dll' v1
- name: Git setup
run: |
git config user.name "GitHub Actions Swagger Bot"
git config user.email "<>"
- shell: pwsh
id: check_file_changed
run: |
git fetch
$diff = git diff --name-only origin/gh-pages
$hasDiff = $diff.Length -gt 0
Write-Host "::set-output name=docs_changed::$hasDiff"
- name: Commit Swagger updates to the gh-pages branch
run: |
git fetch
git add ./swagger/v1/swagger.yaml
git add ./swagger/v1/swagger.json
git stash
git checkout gh-pages
git checkout stash -- .
- shell: pwsh
if: steps.check_file_changed.outputs.docs_changed == 'True'
run: |
git commit -m "GitHub Actions Bot - Update Swagger Documentation"
git push origin gh-pages