🔧 Fixes to the API documentation deployer

This commit is contained in:
David Barragán Merino 2026-01-22 11:38:22 +01:00
parent a1460115e8
commit 16f22a7b5c

View File

@ -7,16 +7,22 @@ on:
- staging - staging
- main - main
paths: paths:
- "plugins/**" - "plugins/libs/plugin-types/index.d.ts"
- ".github/workflows/deploy-plugin-docs.yml" - "plugins/libs/plugin-types/REAME.md"
- "wrangle-penpot-plugins-api-doc.toml" - "plugins/tools/typedoc.css"
- "plugins/CHANGELOG.md"
- "plugins/wrangle-penpot-plugins-api-doc.toml"
workflow_dispatch: workflow_dispatch:
inputs: inputs:
gh_ref: gh_ref:
description: 'Name of the branch or ref' description: 'Name of the branch'
type: string type: choice
required: true required: true
default: 'develop' default: 'develop'
options:
- develop
- staging
- main
permissions: permissions:
contents: read contents: read
@ -24,9 +30,6 @@ permissions:
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults:
run:
working-directory: plugins
steps: steps:
- name: Extract some useful variables - name: Extract some useful variables
id: vars id: vars
@ -39,20 +42,44 @@ jobs:
fetch-depth: 0 fetch-depth: 0
ref: ${{ steps.vars.outputs.gh_ref }} ref: ${{ steps.vars.outputs.gh_ref }}
# START: Setup Node and PNPM enabling cache
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
cache: "pnpm" node-version-file: .nvmrc
- name: Setup pnpm - name: Enable PNPM
uses: pnpm/action-setup@v4 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: 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 - name: Install deps
run: pnpm install --frozen-lockfile working-directory: ./plugins
shell: bash
run: |
pnpm install --no-frozen-lockfile;
pnpm add -D -w wrangler@latest;
- name: Build docs - name: Build docs
working-directory: plugins
shell: bash
run: pnpm run build:doc run: pnpm run build:doc
- name: Select Worker name - name: Select Worker name
@ -68,6 +95,7 @@ jobs:
- name: Deploy to Cloudflare Workers - name: Deploy to Cloudflare Workers
uses: cloudflare/wrangler-action@v3 uses: cloudflare/wrangler-action@v3
with: with:
workingDirectory: plugins
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy --config wrangle-penpot-plugins-api-doc.toml --name ${{ env.WORKER_NAME }} command: deploy --config wrangle-penpot-plugins-api-doc.toml --name ${{ env.WORKER_NAME }}