Skip to content

fix: api doc generation #558

fix: api doc generation

fix: api doc generation #558

Workflow file for this run

name: Generate API
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
inputs:
forceGenerate:
description: 'Force generate all api info'
default: '0'
required: true
push:
branches:
- master
- fix-apidoc
jobs:
build:
runs-on: ubuntu-latest
env:
APP_ENV: dev
APP_URL: http://localhost:8000
DATABASE_URL: mysql://[email protected]/shopware
steps:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "GH_COMPOSER_CACHE=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-6500
restore-keys: |
${{ runner.os }}-composer-
- name: Start MySQL
shell: bash
run: |
sudo mv /var/lib/mysql /var/lib/mysql-old
sudo mkdir /var/lib/mysql
sudo mount -t tmpfs tmpfs /var/lib/mysql -o size=1G
sudo -u mysql mysqld --datadir=/var/lib/mysql --default-time-zone=SYSTEM --initialize-insecure
sudo systemctl start mysql
-
name: Install Shopware CLI
uses: FriendsOfShopware/shopware-cli-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Project
run: shopware-cli project create shopware 6.5.0.0
- name: Install Shopware
working-directory: shopware
run: php bin/console system:install --basic-setup --create-database --force
- name: Start Webserver
working-directory: shopware
run: php -S localhost:8000 -t public public/index.php
- name: Clone api-doc
uses: actions/checkout@v3
with:
path: api-doc
- name: Dump Info
working-directory: api-doc
run: |
php generate-api-info.php
env:
FORCE_GENERATE: ${{ inputs.forceGenerate }}
- uses: EndBug/add-and-commit@v4
with:
add: '.'
cwd: 'api-doc'
author_name: Frosh Automation
author_email: [email protected]
message: 'chore: Updated Swagger definitions'
env:
GITHUB_TOKEN: ${{ secrets.FROSH_CI_TOKEN }}