@@ -31,13 +31,13 @@ jobs:
31
31
run : composer install --no-interaction --prefer-dist
32
32
33
33
- name : Generate OpenAPI Specification JSON
34
- run : vendor/bin/openapi -o docs/openapi .json --format json src
34
+ run : vendor/bin/openapi -o docs/latest-restapi .json --format json src
35
35
36
36
- name : Upload REST API Specification
37
37
uses : actions/upload-artifact@v3
38
38
with :
39
- name : openapi -json
40
- path : docs/openapi .json
39
+ name : restapi -json
40
+ path : docs/latest-restapi .json
41
41
42
42
deploy-docs :
43
43
name : Deploy REST API Specification
50
50
node-version : 14
51
51
52
52
- name : Install openapi-checker
53
- run : npm install -g openapi-checker
53
+ run : npm install -g swagger-cli
54
54
55
55
- name : Checkout REST API Docs Repository
56
56
uses : actions/checkout@v3
@@ -63,12 +63,13 @@ jobs:
63
63
uses : actions/download-artifact@v3
64
64
with :
65
65
name : restapi-json
66
+ path : docs
66
67
67
68
- name : Validate OpenAPI Specification
68
- run : openapi-checker docs/openapi .json
69
+ run : swagger-cli validate docs/latest-restapi .json
69
70
70
71
- name : Compare Specifications
71
- run : git diff --no-index --output=restapi-diff.txt docs/openapi .json restapi.json || true
72
+ run : git diff --no-index --output=restapi-diff.txt docs/latest-restapi .json restapi.json || true
72
73
73
74
- name : Check Differences and Decide Deployment
74
75
id : allow-deploy
84
85
- name : Commit and Deploy Updates
85
86
if : env.DEPLOY == 'true'
86
87
run : |
87
- mv docs/openapi .json docs/restapi.json
88
+ mv docs/latest-restapi .json docs/restapi.json
88
89
git config user.name "github-actions"
89
90
git config user.email "[email protected] "
90
91
git add docs/restapi.json
91
92
git commit -m "Update REST API documentation `date`"
92
- git push origin main --force
93
+ git push
0 commit comments