Skip to content

Add WordPress Playground preview automation for pull requests#132

Open
davidperezgar wants to merge 5 commits intotrunkfrom
claude/add-faq-schema-support-kbeLY
Open

Add WordPress Playground preview automation for pull requests#132
davidperezgar wants to merge 5 commits intotrunkfrom
claude/add-faq-schema-support-kbeLY

Conversation

@davidperezgar
Copy link
Copy Markdown
Contributor

@davidperezgar davidperezgar commented Apr 30, 2026

Summary

This PR adds automated WordPress Playground preview generation for pull requests, enabling reviewers and testers to instantly preview changes in a live WordPress environment without local setup.

Key Changes

  • GitHub Actions Workflow (.github/workflows/playground-preview.yml): New CI/CD workflow that:

    • Builds JavaScript assets and installs PHP dependencies
    • Creates an optimized plugin ZIP file excluding development files and dependencies
    • Generates a WordPress Playground blueprint with base64 encoding
    • Posts an interactive comment on PRs with a direct link to the live preview
    • Automatically cleans up previous bot comments to reduce clutter
  • Playground Blueprint (.wordpress-playground/blueprint.json): Configuration file for local Playground setup that:

    • Configures PHP 8.1 and latest WordPress
    • Auto-logs in with test credentials
    • Pre-installs Frontblocks and GenerateBlocks plugins
    • Opens the block editor for immediate testing

Implementation Details

  • The workflow triggers on PR open, synchronize, and reopen events
  • Plugin ZIP creation uses rsync with extensive exclusions to minimize artifact size (removes node_modules, vendor, tests, docs, config files, etc.)
  • The Playground preview comment includes:
    • Direct link to live preview environment
    • Test credentials (admin/password)
    • Link to built artifact download
    • Branch reference and auto-generated footer
  • Previous preview comments are automatically deleted to keep PR discussions clean
  • Artifacts are retained for 7 days for manual download if needed

claude added 5 commits April 30, 2026 10:13
Adds a GitHub Actions workflow that automatically builds the plugin on
every PR and posts a one-click Playground preview link as a PR comment.
Also includes a blueprint.json with sensible defaults (PHP 8.1, latest WP,
Frontblocks + GenerateBlocks pre-installed, block editor as landing page).

Closes #131

https://claude.ai/code/session_01FXaWGPwXnqJf4PZWzmvUQv
Matches the pattern used in deploy.yml where Composer is installed
manually via the official installer script.

https://claude.ai/code/session_01FXaWGPwXnqJf4PZWzmvUQv
Replaces hardcoded 'frontblocks' with github.event.repository.name so
the ZIP and artifact names always match the repo slug.

https://claude.ai/code/session_01FXaWGPwXnqJf4PZWzmvUQv
@github-actions
Copy link
Copy Markdown

🎮 WordPress Playground Preview

A live preview of this pull request is available via WordPress Playground — no local setup needed.

Live preview Open in WordPress Playground ↗
Credentials Username: admin · Password: password
Plugin artifact Download built ZIP ↗ (GitHub login required · expires in 7 days)

Installs Frontblocks from branch claude/add-faq-schema-support-kbeLY and opens the block editor ready to test.
GenerateBlocks is also pre-installed to test Accordion compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants