Skip to content

Adds composer workflow to deploy vendor#27

Merged
ryanwelcher merged 2 commits intotrunkfrom
feature/composer-vendor-deploys
Mar 2, 2026
Merged

Adds composer workflow to deploy vendor#27
ryanwelcher merged 2 commits intotrunkfrom
feature/composer-vendor-deploys

Conversation

@ryanwelcher
Copy link
Copy Markdown
Collaborator

Closes #15

@ryanwelcher ryanwelcher requested a review from Copilot March 2, 2026 20:23
@ryanwelcher ryanwelcher merged commit 91fb395 into trunk Mar 2, 2026
4 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation and a GitHub Actions workflow to build and deploy Composer vendor/ directories for WordPress plugins/themes to staging/production via SFTP, aligned with Issue #15’s request to include Composer in deployments.

Changes:

  • Documented the vendor-deploy workflow and required GitHub Environments/secrets in readme.md.
  • Added .github/workflows/deploy-vendors.yml to run composer install and upload vendor/ on pushes to trunk/staging (and via manual dispatch).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
readme.md Adds deployment documentation and setup instructions for environment secrets.
.github/workflows/deploy-vendors.yml New workflow to install Composer deps and upload vendor/ via SFTP to WP.com paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## 🚢 Deployment

Vendor folders for plugins and themes with a `composer.json` are built and deployed automatically via [`.github/workflows/deploy-vendors.yml`](.github/workflows/deploy-vendors.yml) on every push to `trunk` or `staging`. It can also be triggered manually via **Actions → Run workflow** in the GitHub UI.
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README implies any plugin/theme that has a composer.json will be built and deployed automatically, but the workflow is hardcoded to specific packages and requires manually adding steps for each new package. Consider rewording this to avoid implying auto-discovery (e.g., “Selected plugins/themes listed in the workflow…”).

Suggested change
Vendor folders for plugins and themes with a `composer.json` are built and deployed automatically via [`.github/workflows/deploy-vendors.yml`](.github/workflows/deploy-vendors.yml) on every push to `trunk` or `staging`. It can also be triggered manually via **Actions → Run workflow** in the GitHub UI.
Selected vendor folders for plugins and themes, as configured in [`.github/workflows/deploy-vendors.yml`](.github/workflows/deploy-vendors.yml), are built and deployed automatically on every push to `trunk` or `staging`. The workflow can also be triggered manually via **Actions → Run workflow** in the GitHub UI.

Copilot uses AI. Check for mistakes.
ftp-password: ${{ secrets.SFTP_PASSWORD }}
local-dir: plugins/bifrost-music/vendor/
# vendor/ is gitignored, so --all forces upload of untracked files
git-ftp-args: ${{ inputs.dry_run == true && '--all --dry-run' || '--all' }}
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputs.dry_run is only defined for workflow_dispatch runs. Because this workflow also runs on push, this expression can fail to evaluate during push-triggered runs. Use a value that exists for all events (e.g., github.event.inputs.dry_run) and default it when not present.

Copilot uses AI. Check for mistakes.
ftp-password: ${{ secrets.SFTP_PASSWORD }}
local-dir: themes/bifrost-noise/vendor/
# vendor/ is gitignored, so --all forces upload of untracked files
git-ftp-args: ${{ inputs.dry_run == true && '--all --dry-run' || '--all' }}
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as above: inputs.dry_run is not available on push events, so this expression can break push-triggered deployments. Prefer github.event.inputs.dry_run (or equivalent) with a safe default.

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +53
working-directory: themes/bifrost-noise
run: composer install --no-dev --optimize-autoloader --no-interaction

- name: Upload theme vendor folder
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

themes/bifrost-noise does not exist in the repository (the themes/ directory currently contains only index.php). As written, this step will fail with a missing working directory. Either add the theme to the repo, correct the path/name, or gate this step so the workflow only runs when the directory exists.

Suggested change
working-directory: themes/bifrost-noise
run: composer install --no-dev --optimize-autoloader --no-interaction
- name: Upload theme vendor folder
if: ${{ hashFiles('themes/bifrost-noise/composer.json') != '' }}
run: |
if [ -d "themes/bifrost-noise" ]; then
cd themes/bifrost-noise
composer install --no-dev --optimize-autoloader --no-interaction
else
echo "themes/bifrost-noise directory not found; skipping theme dependency installation."
fi
- name: Upload theme vendor folder
if: ${{ hashFiles('themes/bifrost-noise/composer.json') != '' }}

Copilot uses AI. Check for mistakes.

jobs:
deploy-vendors:
name: Build and Deploy Vendor Folders
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflow_dispatch allows manually running this workflow from any branch; with the current environment expression, any non-trunk run will target the staging environment and could upload unreviewed branch contents to staging. If that’s not intended, add a branch guard (job-level if:) to only allow trunk/staging, or require an explicit environment/confirm input for manual runs.

Suggested change
name: Build and Deploy Vendor Folders
name: Build and Deploy Vendor Folders
if: ${{ github.ref_name == 'trunk' || github.ref_name == 'staging' }}

Copilot uses AI. Check for mistakes.
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.

Composer deploy workflow

2 participants