-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (38 loc) · 1.43 KB
/
api-doc.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 API Documentation
on:
# schedule:
# Runs at 00:00 every Monday
# - cron: "0 0 * * 1"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
# with:
# ref: seokwon # Specify the branch here
- name: Install curl (for nektos/act local CI testing)
if: ${{ env.ACT }}
run: apt-get update && apt-get install build-essential curl pkg-config openssl -y
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Generate Swagger JSON
run: curl -o openapi.json ${{ secrets.API_ADDRESS }}
- name: Generate Swagger HTML
run: npx @redocly/cli@latest build-docs openapi.json -o ./java/api-ref/index.html
- name: Prepare documentation file
run: mv ./java/api-ref/index.html ./java/api-ref/API-$(date +\%Y\%m\%d).html
- name: List contents of api-ref directory
if: ${{ env.ACT }}
run: ls -l ./java/api-ref/
- name: Commit and Push documentation
if: ${{ !env.ACT }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./java/api-ref/API-*.html
git commit -m "📚 API doc $(date +'%Y-%m-%d')" || echo "No changes to commit"
git push origin main