From 66eb656d18167d5031f491a656c298b740234d11 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 17 Aug 2024 09:19:52 +0200 Subject: [PATCH] chore: Publish typedoc on gh pages https://github.com/Koenkk/zigbee-herdsman/issues/1143 --- .github/workflows/typedoc.yaml | 38 ++++++++++++++++++++++++++++++++++ .gitignore | 1 + package.json | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/typedoc.yaml diff --git a/.github/workflows/typedoc.yaml b/.github/workflows/typedoc.yaml new file mode 100644 index 0000000000..e0e18cf71e --- /dev/null +++ b/.github/workflows/typedoc.yaml @@ -0,0 +1,38 @@ +name: Publish typedoc on Github Pages + +on: + release: + types: + - published + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - name: Generate docs + run: | + npm ci + npm run typedoc + - uses: actions/upload-pages-artifact@v3 + with: + name: github-pages + # typedoc "out" path + path: ./typedoc + deploy: + needs: build + runs-on: ubuntu-latest + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index ca49c49324..58a67f236d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ coverage/ dist/ .idea temp/ +typedoc/ .remote-sync.json tsconfig.tsbuildinfo diff --git a/package.json b/package.json index 02012ad9db..137d2cef3c 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "eslint": "eslint . --ext .ts --max-warnings=0", "pretty:write": "prettier --write .", "pretty:check": "prettier --check .", - "docs": "typedoc --tsconfig typedoc-tsconfig.json", + "typedoc": "typedoc --gitRevision $(git describe --tag --abbrev=0) --tsconfig tsconfig.json --excludePrivate --excludeProtected --excludeExternals --entryPointStrategy expand ./src --sourceLinkTemplate 'https://github.com/Koenkk/zigbee-herdsman/blob/{gitRevision}/{path}#L{line}' -out typedoc", "clean": "rimraf temp coverage dist", "prepack": "npm run clean && npm run build" },