diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..6451483 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -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 \ No newline at end of file