diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..8be44ca --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,69 @@ +name: deploy documentation + +on: + push: + branches: ['develop'] + paths: + - 'docs/**' + - 'packages/*/src/**' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.12.0' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Format documentation + run: | + yarn run format docs + yarn workspace @jpyc/sdk-core run format + + - name: Generate documentation + run: | + echo "Generating documentation..." + set -x + yarn docs || { + echo "Documentation generation failed" + exit 1 + } + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './docs/core-html' + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/packages/core/.prettierignore b/packages/core/.prettierignore index c5f806d..3e007e1 100644 --- a/packages/core/.prettierignore +++ b/packages/core/.prettierignore @@ -6,3 +6,4 @@ cache artifacts node_modules JPYCv2 +docs/core-html/ \ No newline at end of file diff --git a/packages/core/package.json b/packages/core/package.json index dfa23fe..10b9682 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,7 +36,9 @@ "lint:dry-run": "eslint ./src", "format": "prettier --write .", "format:dry-run": "prettier --check .", - "docs": "typedoc" + "docs": "yarn docs:md && yarn docs:html", + "docs:md": "typedoc --plugin typedoc-plugin-markdown --out ../../docs/core", + "docs:html": "typedoc --out ../../docs/core-html" }, "dependencies": { "dotenv": "^16.4.6", diff --git a/typedoc.json b/typedoc.json index 93601be..963935c 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,4 +1,3 @@ { - "plugin": ["typedoc-plugin-markdown"], "cleanOutputDir": false }