Fix filtering of started courses #272
Workflow file for this run
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: Generate Swagger Documentation | |
#on: | |
# push: | |
# branches: | |
# - main | |
on: [pull_request] | |
jobs: | |
swagger-gh-pages: | |
runs-on: ubuntu-latest | |
container: | |
image: escolalms/php:8.2 | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: database | |
MYSQL_PASSWORD: password | |
MYSQL_USER: username | |
ports: | |
- 33306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
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/Http/Controllers/AppBaseController.php', str_replace('SWAGGER_VERSION', '@OA\Info(title=\"EscolaLMS\", version=\"0.0.1\")', file_get_contents('src/Http/Controllers/AppBaseController.php')));" | |
- name: Update composer | |
run: COMPOSER_ROOT_VERSION=0.9.9 composer update | |
- name: Require composer swagger package | |
run: composer require darkaonline/l5-swagger | |
- name: Discover packages | |
run: vendor/bin/testbench package:discover --ansi | |
- name: Generate YAML openapi | |
run: vendor/bin/openapi --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 |