How 10up/action-wordpress-plugin-deploy works
Project type and purpose
• This is a GitHub Action—a CI/CD tool—that automates deployment of a WordPress plugin to the WordPress.org Subversion repository whenever a Git tag or release is created.
Main components
• Developer’s GitHub Repository (source code, action.yml, deploy.sh, examples, workflows)
• GitHub Actions Runner (hosted or self-hosted VM/container that executes the CI job)
• GitHub Actions Workflow (YAML files in .github/workflows)
• Deploy Action (the action’s code: action.yml, deploy.sh, underlying scripts)
• Git Checkout Step (actions/checkout)
• Subversion Repository (WordPress.org plugin repo)
• GitHub Secrets Store (SVN_USERNAME, SVN_PASSWORD)
• Optional Outputs (ZIP artifact, GitHub Release)
Relationships and data flow
a. Trigger: Developer pushes a tag or creates a release → GitHub Events Engine.
b. Workflow Dispatch: The matching YAML in .github/workflows fires and provisions a Runner.
c. Checkout: Runner executes actions/checkout@v4 to pull plugin source.
d. Deploy Action: Runner reads inputs (generate-zip, dry-run, SLUG, etc.) and secrets, then runs deploy.sh:
• Applies .distignore or .gitattributes to exclude development files
• Copies or builds files from BUILD_DIR or root
• Connects to WordPress.org SVN using SVN_USERNAME/PASSWORD
• Commits tag contents to SVN trunk and assets directory
e. Optional ZIP: If generate-zip=true, Action zips the SVN trunk and returns zip-path as output.
f. Optional Release Step: Subsequent workflow steps can use zip-path to attach a ZIP to the GitHub release.
Architectural patterns and design principles
• Event-driven pipeline: reacts to Git events (tag, release)
• Single responsibility: this Action only handles deployment; build steps or asset updates are delegated to other Actions
• Idempotent, ephemeral runners: each run starts fresh, using versioned Action code
• Extensibility via inputs/outputs for customization (SLUG, ASSETS_DIR, BUILD_DIR)
Essential elements
• Clear labels: component names, file paths (e.g., .github/workflows/test.yml, action.yml)
• Code and config files
• Runtime environment (Runner)
• External systems (WordPress.org SVN, GitHub Secrets, GitHub Release)