mirror of
https://github.com/pushbits/server.git
synced 2025-05-01 03:07:09 +02:00
Only push if docs changed
This commit is contained in:
parent
a8e93f1762
commit
0685518efe
2 changed files with 15 additions and 4 deletions
15
.github/workflows/documentation.yml
vendored
15
.github/workflows/documentation.yml
vendored
|
@ -23,14 +23,19 @@ jobs:
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
|
|
||||||
- name: Install swag
|
- name: Export GOBIN
|
||||||
run: go install github.com/swaggo/swag/cmd/swag
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.16
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: make setup
|
||||||
|
|
||||||
- name: Install redoc
|
- name: Install redoc
|
||||||
run: sudo apt install npm && sudo npm install redoc
|
run: sudo apt install npm && sudo npm install redoc
|
||||||
|
|
||||||
- name: Build the API documentation
|
- name: Build the API documentation
|
||||||
run: /home/runner/go/bin/swag init --parseDependency=true -d . -g cmd/pushbits/main.go
|
run: make swag
|
||||||
|
|
||||||
- name: Build static HTML
|
- name: Build static HTML
|
||||||
run: npx redoc-cli bundle docs/swagger.yaml --output index.html
|
run: npx redoc-cli bundle docs/swagger.yaml --output index.html
|
||||||
|
@ -56,4 +61,6 @@ jobs:
|
||||||
- name: Commit and push
|
- name: Commit and push
|
||||||
env:
|
env:
|
||||||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||||
run: cd website && git add . && git commit -m "Update documentation to ${{ github.sha }}" && git push
|
run: |
|
||||||
|
cd website
|
||||||
|
git diff --quiet || ( git add . && git commit -m "Update documentation to ${{ github.sha }}" && git push )
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -19,3 +19,7 @@ setup:
|
||||||
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
|
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
|
||||||
go install github.com/swaggo/swag/cmd/swag@latest
|
go install github.com/swaggo/swag/cmd/swag@latest
|
||||||
go install honnef.co/go/tools/cmd/staticcheck@latest
|
go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||||
|
|
||||||
|
.PHONY: swag
|
||||||
|
swag:
|
||||||
|
swag init --parseDependency=true -d . -g cmd/pushbits/main.go
|
||||||
|
|
Loading…
Add table
Reference in a new issue