Skip to content

Commit

Permalink
ISSUE-337: name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tatevikg1 committed Dec 16, 2024
1 parent 1e4294c commit 2ce9ae1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 742 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/restapi-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
run: composer install --no-interaction --prefer-dist

- name: Generate OpenAPI Specification JSON
run: vendor/bin/openapi -o docs/openapi.json --format json src
run: vendor/bin/openapi -o docs/latest-restapi.json --format json src

- name: Upload REST API Specification
uses: actions/upload-artifact@v3
with:
name: openapi-json
path: docs/openapi.json
name: restapi-json
path: docs/latest-restapi.json

deploy-docs:
name: Deploy REST API Specification
Expand All @@ -50,7 +50,7 @@ jobs:
node-version: 14

- name: Install openapi-checker
run: npm install -g openapi-checker
run: npm install -g swagger-cli

- name: Checkout REST API Docs Repository
uses: actions/checkout@v3
Expand All @@ -63,12 +63,13 @@ jobs:
uses: actions/download-artifact@v3
with:
name: restapi-json
path: docs

- name: Validate OpenAPI Specification
run: openapi-checker docs/openapi.json
run: swagger-cli validate docs/latest-restapi.json

- name: Compare Specifications
run: git diff --no-index --output=restapi-diff.txt docs/openapi.json restapi.json || true
run: git diff --no-index --output=restapi-diff.txt docs/latest-restapi.json restapi.json || true

- name: Check Differences and Decide Deployment
id: allow-deploy
Expand All @@ -84,9 +85,9 @@ jobs:
- name: Commit and Deploy Updates
if: env.DEPLOY == 'true'
run: |
mv docs/openapi.json docs/restapi.json
mv docs/latest-restapi.json docs/restapi.json
git config user.name "github-actions"
git config user.email "[email protected]"
git add docs/restapi.json
git commit -m "Update REST API documentation `date`"
git push origin main --force
git push
Loading

0 comments on commit 2ce9ae1

Please sign in to comment.