-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (39 loc) · 1.54 KB
/
swagger.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
name: Generate Swagger Documentation
on:
push:
branches:
- main
jobs:
swagger-gh-pages:
runs-on: ubuntu-latest
container:
image: escolalms/php:8.2
steps:
- name: Instantiate package
uses: actions/checkout@v2
- name: Setup environment
run: cp -r env/codecov/. .
- name: add Swagger main annotaion
run: php -r "file_put_contents('src/EscolaLmsConsultationsServiceProvider.php', str_replace('SWAGGER_VERSION', '@OA\Info(title=\"EscolaLMS\", version=\"0.0.1\")', file_get_contents('src/EscolaLmsConsultationsServiceProvider.php')));"
- name: Update composer
run: COMPOSER_ROOT_VERSION=0.9.9 composer update
- name: Require composer swagger package
run: composer require darkaonline/l5-swagger zircote/swagger-php swagger-api/swagger-ui
- name: Discover packages
run: vendor/bin/testbench package:discover --ansi
- name: Generate YAML openapi
run: vendor/bin/openapi --debug --format json -b env/openapi/config.php -o openapi.json ./src/ ./vendor/escolalms/auth/src/Models/
- name: Generate Swagger UI
uses: Legion2/swagger-ui-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
output: swagger-ui
spec-file: openapi.json
- name: Install git
run: apt-get install git -y
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: swagger-ui