From 8adb6271a9c8660e3beb842a443df54863516fa0 Mon Sep 17 00:00:00 2001 From: Pileks Date: Tue, 19 Sep 2023 19:18:27 +0200 Subject: [PATCH] add CD for documentation on push to main --- .github/workflows/cd-docs.yaml | 48 ++++++++++++++++++++++++++++++++++ package.json | 1 + yarn.lock | 18 ++++++------- 3 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/cd-docs.yaml diff --git a/.github/workflows/cd-docs.yaml b/.github/workflows/cd-docs.yaml new file mode 100644 index 000000000..ae3103ad7 --- /dev/null +++ b/.github/workflows/cd-docs.yaml @@ -0,0 +1,48 @@ +name: Build and Deploy Documentation + +on: + push: + branches: + main + +jobs: + deploy-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Read .nvmrc + run: echo ::set-output name=NVMRC::$(cat .nvmrc) + id: nvm + + - name: Setup Node.js + uses: actions/setup-node@master + with: + node-version: '${{ steps.nvm.outputs.NVMRC }}' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: (yarn install --nonInteractive --frozen-lockfile --prefer-offline || yarn install --nonInteractive --frozen-lockfile --prefer-offline) + + - name: Build + run: yarn build + + - name: Generate reference + run: yarn build:reference + + - name: Deploy documentation to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages-reference + folder: reference \ No newline at end of file diff --git a/package.json b/package.json index 507df0998..886a69e6d 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "build:bundles": "lerna run build --scope @polywrap/*-config-bundle-js", "build:client": "lerna run build --scope @polywrap/core-client-js --scope @polywrap/client-js --scope @polywrap/client-config-builder-js", "build:docs": "lerna run build:docs", + "build:reference": "npx typedoc", "lint": "lerna run lint", "lint:fix": "lerna run lint -- --fix", "lint:ci": "yarn lint", diff --git a/yarn.lock b/yarn.lock index b78ba86d9..76cc8ad59 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3107,9 +3107,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001517: - version "1.0.30001535" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001535.tgz#908a5b7ef11172f51f0b88f3d850aef1c6a3cf7b" - integrity sha512-48jLyUkiWFfhm/afF7cQPqPjaUmSraEhK4j+FCTJpgnGGEZHqyLe3hmWH7lIooZdSzXL0ReMvHz0vKDoTBsrwg== + version "1.0.30001538" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz#9dbc6b9af1ff06b5eb12350c2012b3af56744f3f" + integrity sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw== caseless@~0.12.0: version "0.12.0" @@ -7866,9 +7866,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.13" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" - integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== + version "3.0.14" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.14.tgz#d16b09577b7de461c8c3e69734c4b9b467ac791f" + integrity sha512-U0eS5wcpu/O2/QZk6PcAMOA8H3ZuvRe4mFHA3Q+LNl1SRDmfQ+mD3RoD6tItqnvqubJ32m/zV2Z/ikSmxccD1Q== split-on-first@^1.0.0: version "1.1.0" @@ -8605,9 +8605,9 @@ vscode-languageserver-textdocument@^1.0.3: integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q== vscode-languageserver-types@^3.16.0: - version "3.17.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" - integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== + version "3.17.4" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4.tgz#0b422ecbc305f364f6579ba9e32b1d7ddb7ca789" + integrity sha512-9YXi5pA3XF2V+NUQg6g+lulNS0ncRCKASYdK3Cs7kiH9sVFXWq27prjkC/B8M/xJLRPPRSPCHVMuBTgRNFh2sQ== vscode-nls@^5.0.0: version "5.2.0"