2023-06-03 23:56:15 +02:00
|
|
|
name: Update Swagger
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
2024-02-11 17:47:00 +01:00
|
|
|
branches:
|
2023-06-03 23:56:15 +02:00
|
|
|
- master
|
|
|
|
jobs:
|
|
|
|
push:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3.5.2
|
2024-02-11 17:47:00 +01:00
|
|
|
|
2023-06-03 23:56:15 +02:00
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3.11.0
|
|
|
|
with:
|
|
|
|
java-version: '17'
|
|
|
|
distribution: 'temurin'
|
2024-02-11 17:47:00 +01:00
|
|
|
|
2023-06-03 23:56:15 +02:00
|
|
|
- name: Grant execute permission for gradlew
|
|
|
|
run: chmod +x gradlew
|
|
|
|
|
|
|
|
- name: Generate Swagger documentation
|
|
|
|
run: ./gradlew generateOpenApiDocs
|
|
|
|
|
|
|
|
- name: Upload Swagger Documentation to SwaggerHub
|
2023-06-04 00:24:40 +02:00
|
|
|
run: ./gradlew swaggerhubUpload
|
2023-06-03 23:56:15 +02:00
|
|
|
env:
|
|
|
|
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
|
2023-06-04 00:32:47 +02:00
|
|
|
|
|
|
|
- name: Set API version as published and default on SwaggerHub
|
|
|
|
run: |
|
|
|
|
curl -X PUT -H "Authorization: ${SWAGGERHUB_API_KEY}" "https://api.swaggerhub.com/apis/Frooodle/Stirling-PDF/${{ steps.versionNumber.outputs.versionNumber }}/settings/lifecycle" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"published\":true,\"default\":true}"
|
|
|
|
env:
|
|
|
|
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
|