From f9ae7f319a80e5b4f0017ff054eab47d88f0b9c1 Mon Sep 17 00:00:00 2001 From: Cubicroot Date: Thu, 30 Sep 2021 19:24:20 +0200 Subject: [PATCH] add new pipeline for docu build --- .github/workflows/documentation.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/documentation.yml 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