Merge pull request #319 from liujuanjuan1984/main #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |