diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000000..4e050ed193 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,29 @@ +name: Build and Deploy Docs +on: + push: + branches: + - master +jobs: + build-and-deploy-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.1 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '14.x' + # Pre-check to validate that versions match between package.json + # and package-lock.json. Needs to run before npm install + - name: Validate package.json and package-lock.json versions + run: node version-check.js + - name: Install dependencies + run: npm ci + - name: Build docs + run: npm run docs + + - name: Deploy docs + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + branch: gh-pages # The branch the action should deploy to. + folder: docs # The folder the action should deploy. diff --git a/README.md b/README.md index 7eaa2718a7..4d9cc084f3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://github.com/kubernetes-client/javascript/workflows/Kubernetes%20Javascript%20Client%20-%20Validation/badge.svg)](https://github.com/kubernetes-client/javascript/actions) [![Client Capabilities](https://img.shields.io/badge/Kubernetes%20client-Gold-blue.svg?style=flat&colorB=FFD700&colorA=306CE8)](http://bit.ly/kubernetes-client-capabilities-badge) [![Client Support Level](https://img.shields.io/badge/kubernetes%20client-beta-green.svg?style=flat&colorA=306CE8)](http://bit.ly/kubernetes-client-support-badge) +[![Build and Deploy Docs](https://github.com/kubernetes-client/javascript/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/kubernetes-client/javascript/actions/workflows/deploy-docs.yml) The Javascript clients for Kubernetes is implemented in [typescript](https://typescriptlang.org), but can be called from either @@ -99,9 +100,14 @@ const k8sApi = kc.makeApiClient(k8s.CoreV1Api); ... ``` -# Additional Examples +# Additional Examples and Documentation -There are several more examples in the [examples](https://github.com/kubernetes-client/javascript/tree/master/examples) directory. +There are several more JS and TS examples in the [examples](https://github.com/kubernetes-client/javascript/tree/master/examples) directory. + +Documentation for the library is split into two resources: + +1. The [Kubernetes API Reference](https://kubernetes.io/docs/reference/) is the source-of-truth for all Kubernetes client libraries, including this one. We suggest starting here! +2. The Typedoc autogenerated docs can be viewed [online](https://kubernetes-client.github.io/javascript) and can also be built locally (see below) # Compatibility