From 45230c63125481be301ff397e39397e592557646 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 6 Dec 2024 16:46:27 -0800 Subject: [PATCH] build: publish API documentation (#217) Co-authored-by: David Sanders --- .github/workflows/docs.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..18a961f --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,32 @@ +name: Publish API documentation + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+* + +permissions: {} + +jobs: + docs: + runs-on: ubuntu-24 + environment: + name: publish-docs + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # tag: v4.1.0 + with: + node-version: lts/* + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Build API documentation + run: yarn build:docs + - name: Upload to Azure Blob Storage + uses: azure/cli@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # tag: v2.1.0 + with: + azcliversion: latest + inlineScript: | + az storage blob upload-batch --account-name $ACCOUNT_NAME -d '$web/notarize/${{ github.ref_name }}' -s ./docs --overwrite --sas-token "$SAS_TOKEN" + env: + SAS_TOKEN: ${{ secrets.SAS_TOKEN }} + ACCOUNT_NAME: ${{ secrets.ACCOUNT_NAME }} diff --git a/package.json b/package.json index c4664c3..ef7d57f 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "scripts": { "build": "tsc", + "build:docs": "npx typedoc", "lint": "prettier --check \"src/**/*.ts\"", "prepare": "yarn build", "test": "jest"