Generate API #1261
This file contains hidden or 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 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://root@127.0.0.1/shopware | |
| COMPOSER_NO_AUDIT: "1" | |
| steps: | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: | | |
| echo "dir=$(composer global 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: Install Shopware CLI | |
| uses: FriendsOfShopware/shopware-cli-action@main | |
| - name: Create Project | |
| run: shopware-cli project create shopware 6.6.9.0 | |
| - name: Clone api-doc | |
| uses: actions/checkout@v4 | |
| with: | |
| path: api-doc | |
| token: ${{ secrets.FROSH_CI_TOKEN }} | |
| - 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: ci@fos.gg | |
| message: 'chore: Updated Swagger definitions' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.FROSH_CI_TOKEN }} |