From ada595a7658ec5adb7c69c3729626036dc55b72c Mon Sep 17 00:00:00 2001 From: Haythem Farhat Date: Thu, 10 Oct 2024 10:58:42 +0100 Subject: [PATCH] feat: publish generated docs to gh pages --- .github/workflows/publish-gh-pages.yml | 31 ++++++++++++++++++++++++++ packages/js/package.json | 1 + packages/js/typedoc.html.json | 23 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 .github/workflows/publish-gh-pages.yml create mode 100644 packages/js/typedoc.html.json diff --git a/.github/workflows/publish-gh-pages.yml b/.github/workflows/publish-gh-pages.yml new file mode 100644 index 00000000..ce147205 --- /dev/null +++ b/.github/workflows/publish-gh-pages.yml @@ -0,0 +1,31 @@ +name: publish-gh-pages + +on: + pull_request: + workflow_dispatch: + +jobs: + build_and_lint: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "yarn" + + - name: Install dependencies + run: yarn install --immutable + + - name: Create the docs directory locally in CI + working-directory: packages/js + run: yarn docs:html + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: packages/js/docs diff --git a/packages/js/package.json b/packages/js/package.json index 3160ea89..25e0897b 100644 --- a/packages/js/package.json +++ b/packages/js/package.json @@ -25,6 +25,7 @@ "prepare": "yarn build", "test": "jest", "docs": "typedoc --entryPointStrategy expand ./src", + "docs:html": "typedoc --entryPointStrategy expand --options typedoc.html.json ./src", "release": "release-it", "compile": "../../node_modules/.bin/tsc -w", "format": "prettier --write 'src/**/*.ts'", diff --git a/packages/js/typedoc.html.json b/packages/js/typedoc.html.json new file mode 100644 index 00000000..b5bb5d5c --- /dev/null +++ b/packages/js/typedoc.html.json @@ -0,0 +1,23 @@ +{ + "out": "./docs/ts", + "entryPoints": ["./src/index.ts"], + "exclude": [ + "**/*+(test|index).ts", + "src/Modules/Verto/messages/**/*", + "src/Modules/Verto/services/**/*", + "src/Modules/Verto/tests/**/*", + "src/Modules/Verto/util/**/*" + ], + "plugin": ["typedoc-plugin-merge-modules"], + "excludeExternals": true, + "excludePrivate": true, + "excludeProtected": true, + "excludeNotDocumented": true, + "githubPages": true, + "excludeTags": ["@internalnote", "@internal"], + "cleanOutputDir": true, + "hideGenerator": true, + "readme": "none", + "gitRevision": "main", + "disableSources": true +}