-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (39 loc) · 1.23 KB
/
generate-open-api-document.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Generate OpenAPI Document
on:
push:
branches-ignore:
- main
jobs:
generate-open-api-document:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Start containers
run: docker-compose -f "docker-compose.yml" up -d --build
- name: Check the deployed service URL
uses: jtalk/url-health-check-action@v3
with:
url: http://localhost:8080/api-docs.yaml
max-attempts: 10
retry-delay: 5s
retry-all: true
- name: Create json file
run: |
curl -o docs/open-api.yaml http://localhost:8080/api-docs.yaml
- name: Commit changes
run: |
git config --global user.name 'Git Actions'
git config --global user.email 'no-reply@github.com'
git add docs/open-api.yaml
if git status | grep -ic "Changes to be committed:"; then
echo "Committing changes"
git commit -m "docs: update open-api.yaml"
git push
else
echo "No changes"
fi
- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down