From 4db3340efef53b0f83c11ba43a8cd99dc8bcff85 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Wed, 19 Feb 2025 12:12:57 -0800 Subject: [PATCH] docs: move API docs to `packages.electronjs.org` (#315) --- .github/workflows/docs.yml | 44 +++++++++++++++----------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c713d3df..c13c84c3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,44 +2,34 @@ name: Publish documentation on: push: - branches: - - main tags: - v[0-9]+.[0-9]+.[0-9]+* -permissions: {} +permissions: + id-token: write + contents: read jobs: docs: runs-on: ubuntu-latest + environment: docs-publish steps: - - name: Generate GitHub App token - uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 - id: generate-token - with: - creds: ${{ secrets.GH_APP_CREDS }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2 - with: - token: ${{ steps.generate-token.outputs.token }} - - name: Fetch all git branches - run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # tag: v4.2.0 with: node-version: 22.12.x - - run: yarn --frozen-lockfile - - run: yarn build:docs - - name: Prepare docs - uses: malept/github-action-gh-pages@f7952a65c4b763dc84b824a530dc38bd375ac91e # tag: v1.4.0 + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Build API documentation + run: yarn build:docs + - name: Azure login + uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0 with: - defaultBranch: main - noCommit: true - showUnderscoreFiles: true - versionDocs: true - env: - GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} - - name: Commit docs - uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0 + client-id: ${{ secrets.AZURE_OIDC_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_OIDC_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_OIDC_SUBSCRIPTION_ID }} + - name: Upload to Azure Blob Storage + uses: azure/cli@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # tag: v2.1.0 with: - fail-on-no-changes: false - message: 'Publish [skip ci]' - token: ${{ steps.generate-token.outputs.token }} + inlineScript: | + az storage blob upload-batch --account-name ${{ secrets.AZURE_ECOSYSTEM_PACKAGES_STORAGE_ACCOUNT_NAME }} -d '$web/get/${{ github.ref_name }}' -s ./docs --overwrite --auth-mode login