From ab5f2def9f70e6ab26ce45b9d36b59872f908ff5 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Thu, 14 Nov 2024 15:12:49 -0800 Subject: [PATCH 1/8] dummy action --- .github/workflows/docs.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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..d2f4104 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,23 @@ +name: Publish documentation + +on: + push: + branches: + - build/docs-website-action # TEST ACTION + tags: + - v[0-9]+.[0-9]+.[0-9]+* + +permissions: {} + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag: v4.1.7 + - name: Fetch all git branches + run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # tag: v4.0.3 + with: + node-version: lts/* + - run: yarn --frozen-lockfile + - run: yarn build:docs From 6a893e7a7576fd795f82d8125cf1cee804f766d4 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Thu, 14 Nov 2024 15:14:13 -0800 Subject: [PATCH 2/8] add typedoc command to npm scripts --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index ea8672c..2d77de6 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" From 08739c9329a2440eee43c93480f20cf95d51f87c Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 15 Nov 2024 11:02:18 -0800 Subject: [PATCH 3/8] add az script action --- .github/workflows/docs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d2f4104..1247bf4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -21,3 +21,9 @@ jobs: node-version: lts/* - run: yarn --frozen-lockfile - run: yarn build:docs + - name: Azure CLI script + uses: azure/cli@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # tag: v2.1.0 + with: + azcliversion: latest + inlineScript: | + az storage -h From 754db8bf9b20958ad9cda1943f99f3526f19a3d6 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 15 Nov 2024 12:08:55 -0800 Subject: [PATCH 4/8] attempt to upload to azure CLI --- .github/workflows/docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1247bf4..1e8b1b9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,4 +26,6 @@ jobs: with: azcliversion: latest inlineScript: | - az storage -h + az storage blob upload-batch --account-name electronecosystemapidocs -d '$web' -s ./docs --overwrite --sas-token "$SAS" + env: + SAS: ${{ secrets.SAS }} From f5326492a9857e1edb2ee2e055c414e567c5bc08 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 15 Nov 2024 12:12:14 -0800 Subject: [PATCH 5/8] use correct secret name --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1e8b1b9..24c7ff2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,6 +26,6 @@ jobs: with: azcliversion: latest inlineScript: | - az storage blob upload-batch --account-name electronecosystemapidocs -d '$web' -s ./docs --overwrite --sas-token "$SAS" + az storage blob upload-batch --account-name electronecosystemapidocs -d '$web' -s ./docs --overwrite --sas-token "$SAS_TOKEN" env: - SAS: ${{ secrets.SAS }} + SAS_TOKEN: ${{ secrets.SAS_TOKEN }} From a8ce1566f0e3b51727ebef75dbc05295fe6d25bc Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 15 Nov 2024 12:25:28 -0800 Subject: [PATCH 6/8] clean up action --- .github/workflows/docs.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 24c7ff2..890a924 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,9 +1,7 @@ -name: Publish documentation +name: Publish API documentation on: push: - branches: - - build/docs-website-action # TEST ACTION tags: - v[0-9]+.[0-9]+.[0-9]+* @@ -14,14 +12,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag: v4.1.7 - - name: Fetch all git branches - run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # tag: v4.0.3 with: node-version: lts/* - - run: yarn --frozen-lockfile - - run: yarn build:docs - - name: Azure CLI script + - 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 From e43089d6aff8a9e94e254bdc72aa1f16d813ad2a Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 15 Nov 2024 13:02:25 -0800 Subject: [PATCH 7/8] upload to subdirectory --- .github/workflows/docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 890a924..c1126fa 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,6 +2,8 @@ name: Publish API documentation on: push: + branches: + - build/docs-website-action # TEST ACTION tags: - v[0-9]+.[0-9]+.[0-9]+* @@ -24,6 +26,6 @@ jobs: with: azcliversion: latest inlineScript: | - az storage blob upload-batch --account-name electronecosystemapidocs -d '$web' -s ./docs --overwrite --sas-token "$SAS_TOKEN" + az storage blob upload-batch --account-name electronecosystemapidocs -d '$web/notarize/${{ github.ref_name }}' -s ./docs --overwrite --sas-token "$SAS_TOKEN" env: SAS_TOKEN: ${{ secrets.SAS_TOKEN }} From 5c799fa46c4869006d8aa6a410269308ab087ee7 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 15 Nov 2024 13:17:33 -0800 Subject: [PATCH 8/8] remove on branch push --- .github/workflows/docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c1126fa..c8df4ab 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,8 +2,6 @@ name: Publish API documentation on: push: - branches: - - build/docs-website-action # TEST ACTION tags: - v[0-9]+.[0-9]+.[0-9]+*