add new pipeline for docu build

This commit is contained in:
Cubicroot 2021-09-30 19:24:20 +02:00
parent db9eaa796a
commit f9ae7f319a

29
.github/workflows/documentation.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Documentation
on:
push:
paths-ignore:
- '**.md'
- '**.yml'
- '**.jpg'
- '**.jpeg'
- '**.png'
- '**.yaml'
- '**.json'
jobs:
build_documentation:
runs-on: ubuntu-latest
# TODO Activate later: if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Install swag
run: go install github.com/swaggo/swag/cmd/swag@latest
- name: Install redoc
run: sudo apt install npm && sudo npm install redoc
- name: Build the api documentation
run: swag init --parseDependency=true -d . -g cmd/pushbits/main.go
- name: Build static html
run: npx redoc-cli bundle docs/swagger.yaml --output index.html
# TODO copy index.html to new repo