-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cron task to update the documentation API JSON file
- Loading branch information
1 parent
076e9c4
commit b35c80d
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Update API json doc | ||
|
||
on: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-api: | ||
name: Update API doc json | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
ps_branch: | ||
- develop | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Checkout PrestaShop | ||
- uses: actions/checkout@v4 | ||
name: Checkout PrestaShop repository | ||
with: | ||
repository: PrestaShop/PrestaShop | ||
ref: ${{ matrix.ps_branch }} | ||
|
||
# Now install the shop | ||
- name: Setup Environment | ||
timeout-minutes: 15 | ||
uses: .github/actions/setup-env | ||
with: | ||
PHP_VERSION: 8.1 | ||
ENABLE_SSL: 'true' | ||
INSTALL_AUTO: 'true' | ||
- name: Setup Environment failure | ||
uses: .github/actions/setup-env-export-logs | ||
with: | ||
DOCKER_PREFIX: prestashop | ||
ARTIFACT_NAME: setup-symfony-console-${{ matrix.app-id }} | ||
ENABLE_SSL: 'true' | ||
INSTALL_AUTO: 'true' | ||
if: failure() | ||
|
||
- name: Check folder | ||
working-directory: docs | ||
run: | | ||
ls -l ${{ github.workspace }} | ||
ls -l ${{ github.workspace }}/var | ||
# Checkout Docs | ||
- uses: actions/checkout@v4 | ||
name: Checkout Docs | ||
with: | ||
path: ${{ github.workspace }}/var/docs | ||
|
||
- name: Check folder | ||
working-directory: docs | ||
run: | | ||
ls -l ${{ github.workspace }}/var/docs | ||
# Export the JSON Api file | ||
- name: Execute core command to export the JSON API doc | ||
run: | | ||
ls -l ${{ github.workspace }}/docs | ||
docker ps | ||
docker exec docs-prestashop-git-1 php -d memory_limit=-1 ./bin/console prestashop:generate:apidoc > ${{ github.workspace }}/docs/admin-api/swagger-docs/openapi.json | ||
working-directory: prestashop | ||
|
||
- name: Check modifications and commit if any | ||
working-directory: docs | ||
run: | | ||
ls -l . | ||
git status |