mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
Bump the pnpm pin to 12.14.0 in the devenv and the production images and stamp the same version into every package.json, realigning the drift between the devenv (12.9.1) and the rest (12.6.0). Bump Node to v24.22.0, the newest patch of the Krypton LTS line, in .nvmrc, the devenv and image Dockerfiles and the plugins-deploy workflows. The pnpm arch checksums are those of the GitHub release tarballs, not of the npm package. Lockfile changes are metadata only. AI-assisted-by: deepseek-v4.1-flash
126 lines
4.0 KiB
YAML
126 lines
4.0 KiB
YAML
name: Plugins/styles-doc deployer
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
- staging
|
|
- main
|
|
paths:
|
|
- 'plugins/apps/example-styles/**'
|
|
- 'plugins/libs/plugins-styles/**'
|
|
- 'plugins/wrangler-penpot-plugins-styles-doc.toml'
|
|
workflow_dispatch:
|
|
inputs:
|
|
gh_ref:
|
|
description: 'Name of the branch'
|
|
type: choice
|
|
required: true
|
|
default: 'develop'
|
|
options:
|
|
- develop
|
|
- staging
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Extract some useful variables
|
|
id: vars
|
|
env:
|
|
GH_REF: ${{ inputs.gh_ref || github.ref_name }}
|
|
run: |
|
|
echo "gh_ref=$GH_REF" >> $GITHUB_OUTPUT
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
ref: ${{ steps.vars.outputs.gh_ref }}
|
|
|
|
# No dependency cache here: a deploy must not restore a cache that
|
|
# other workflows can write to.
|
|
- name: Setup pnpm + Node.js
|
|
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
|
|
with:
|
|
working-directory: plugins
|
|
runtime: node@24.22.0
|
|
install: false
|
|
|
|
- name: Install deps
|
|
working-directory: ./plugins
|
|
shell: bash
|
|
run: |
|
|
pnpm install --frozen-lockfile;
|
|
pnpm add -D -w wrangler@latest;
|
|
|
|
- name: Build styles
|
|
working-directory: plugins
|
|
shell: bash
|
|
run: pnpm run build:styles-example
|
|
|
|
- name: Select Worker name
|
|
env:
|
|
REF: ${{ steps.vars.outputs.gh_ref }}
|
|
run: |
|
|
case "$REF" in
|
|
main)
|
|
echo "WORKER_NAME=penpot-plugins-styles-doc-pro" >> $GITHUB_ENV
|
|
echo "WORKER_URI=styles-doc.plugins.penpot.app" >> $GITHUB_ENV ;;
|
|
staging)
|
|
echo "WORKER_NAME=penpot-plugins-styles-doc-pre" >> $GITHUB_ENV
|
|
echo "WORKER_URI=styles-doc.plugins.penpot.dev" >> $GITHUB_ENV ;;
|
|
develop)
|
|
echo "WORKER_NAME=penpot-plugins-styles-doc-hourly" >> $GITHUB_ENV
|
|
echo "WORKER_URI=styles-doc.plugins.hourly.penpot.dev" >> $GITHUB_ENV ;;
|
|
*) echo "Unsupported branch ${REF}" && exit 1 ;;
|
|
esac
|
|
|
|
- name: Set the custom url
|
|
working-directory: plugins
|
|
shell: bash
|
|
run: |
|
|
sed -i "s/WORKER_URI/${WORKER_URI}/g" wrangler-penpot-plugins-styles-doc.toml
|
|
|
|
- name: Add noindex header and robots.txt files for non-production environments
|
|
if: ${{ steps.vars.outputs.gh_ref != 'main' }}
|
|
working-directory: plugins
|
|
shell: bash
|
|
run: |
|
|
ASSETS_DIR="dist/apps/example-styles"
|
|
|
|
cat > "${ASSETS_DIR}/_headers" << 'EOF'
|
|
/*
|
|
X-Robots-Tag: noindex, nofollow
|
|
EOF
|
|
|
|
cat > "${ASSETS_DIR}/robots.txt" << 'EOF'
|
|
User-agent: *
|
|
Disallow: /
|
|
EOF
|
|
|
|
- name: Deploy to Cloudflare Workers
|
|
uses: cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4.1.3
|
|
with:
|
|
workingDirectory: plugins
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: deploy --config wrangler-penpot-plugins-styles-doc.toml --name ${{ env.WORKER_NAME }}
|
|
|
|
- name: Notify Mattermost
|
|
if: failure()
|
|
uses: mattermost/action-mattermost-notify@ae31bb6f9e26a54336e79696f108a2c91cf55b4e # v2.1.0
|
|
with:
|
|
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK }}
|
|
MATTERMOST_CHANNEL: bot-alerts-cicd
|
|
TEXT: |
|
|
❌ 🧩💅 *[PENPOT PLUGINS] Error deploying Styles documentation.*
|
|
📄 Triggered from ref: `${{ inputs.gh_ref }}`
|
|
🔗 Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
@infra
|