-
Notifications
You must be signed in to change notification settings - Fork 33
61 lines (51 loc) · 1.64 KB
/
update.api.page.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Update Quorum Api Github Page
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-20.04
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ">=1.19.0"
- name: Checkout quorum repo
uses: actions/checkout@v3
- name: Swag Init
run: |
go install github.com/swaggo/swag/cmd/[email protected]
make gen-doc
- name: Check swagger.json generated
id: check_files
uses: andstor/[email protected]
with:
files: "docs/swagger.json"
- name: Quit workflow when generating swagger.json failure
if: steps.check_files.outputs.files_exists == 'false'
run: |
echo swag init failure
exit 1
- name: Upload swagger.json to artifact
uses: actions/upload-artifact@v3
with:
name: quorum-artifact
path: docs/swagger.json
- name: Checkout quorum-api repo
uses: actions/checkout@v3
with:
repository: rumsystem/quorum-api
ssh-key: ${{ secrets.QUORUM_API_ACCESS_KEY }}
- name: Download swagger.json from artifact
uses: actions/download-artifact@v3
with:
name: quorum-artifact
path: docs
- name: Commit and Push
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git diff-index --quiet HEAD || git commit -m "generated from $(git rev-parse --short ${GITHUB_SHA}) of quorum repo"
git push