From 16f22a7b5c5fbd817db40fd67368cb629a3da56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Thu, 22 Jan 2026 11:38:22 +0100 Subject: [PATCH] :wrench: Fixes to the API documentation deployer --- .github/workflows/plugins-deploy-api-doc.yml | 58 +++++++++++++++----- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/.github/workflows/plugins-deploy-api-doc.yml b/.github/workflows/plugins-deploy-api-doc.yml index 1c67d4f47b..62a87745bb 100644 --- a/.github/workflows/plugins-deploy-api-doc.yml +++ b/.github/workflows/plugins-deploy-api-doc.yml @@ -7,16 +7,22 @@ on: - staging - main paths: - - "plugins/**" - - ".github/workflows/deploy-plugin-docs.yml" - - "wrangle-penpot-plugins-api-doc.toml" + - "plugins/libs/plugin-types/index.d.ts" + - "plugins/libs/plugin-types/REAME.md" + - "plugins/tools/typedoc.css" + - "plugins/CHANGELOG.md" + - "plugins/wrangle-penpot-plugins-api-doc.toml" workflow_dispatch: inputs: gh_ref: - description: 'Name of the branch or ref' - type: string + description: 'Name of the branch' + type: choice required: true default: 'develop' + options: + - develop + - staging + - main permissions: contents: read @@ -24,9 +30,6 @@ permissions: jobs: deploy: runs-on: ubuntu-latest - defaults: - run: - working-directory: plugins steps: - name: Extract some useful variables id: vars @@ -39,20 +42,44 @@ jobs: fetch-depth: 0 ref: ${{ steps.vars.outputs.gh_ref }} + # START: Setup Node and PNPM enabling cache - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - cache: "pnpm" + node-version-file: .nvmrc - - name: Setup pnpm - uses: pnpm/action-setup@v4 + - name: Enable PNPM + working-directory: ./plugins + shell: bash + run: | + corepack enable; + corepack install; + + - name: Get pnpm store path + id: pnpm-store + working-directory: ./plugins + shell: bash + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + + - name: Cache pnpm store + uses: actions/cache@v4 with: - run_install: false + path: ${{ steps.pnpm-store.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-${{ hashFiles('plugins/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- + # END: Setup Node and PNPM enabling cache - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Install deps + working-directory: ./plugins + shell: bash + run: | + pnpm install --no-frozen-lockfile; + pnpm add -D -w wrangler@latest; - name: Build docs + working-directory: plugins + shell: bash run: pnpm run build:doc - name: Select Worker name @@ -68,6 +95,7 @@ jobs: - name: Deploy to Cloudflare Workers uses: cloudflare/wrangler-action@v3 with: + workingDirectory: plugins apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} command: deploy --config wrangle-penpot-plugins-api-doc.toml --name ${{ env.WORKER_NAME }}