Skip to content

Commit e596bbd

Browse files
committed
Merge branch 'feature/composer-vendor-deploys' into staging
2 parents b224325 + be62128 commit e596bbd

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/deploy-vendors.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ jobs:
2828
php-version: '8.2'
2929
tools: composer
3030

31+
# ── Pre-create remote vendor directories ───────────────────────────────
32+
# Runs once on first deploy when vendor/ doesn't exist yet on the server.
33+
# lftp mkdir -fp is silent when the directory already exists.
34+
35+
- name: Ensure remote vendor directories exist
36+
if: ${{ inputs.dry_run != true }}
37+
env:
38+
SFTP_USER: ${{ secrets.SFTP_USER }}
39+
SFTP_PASSWORD: ${{ secrets.SFTP_PASSWORD }}
40+
run: |
41+
sudo apt-get install -y lftp
42+
mkdir -p ~/.ssh
43+
echo "${{ secrets.SFTP_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
44+
lftp -e "
45+
mkdir -fp htdocs/wp-content/plugins/bifrost-music/vendor;
46+
mkdir -fp htdocs/wp-content/themes/bifrost-noise/vendor;
47+
quit
48+
" -u "$SFTP_USER,$SFTP_PASSWORD" sftp://sftp.wp.com
49+
3150
# ── Plugin ─────────────────────────────────────────────────────────────
3251

3352
- name: Install plugin dependencies (bifrost-music)

readme.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ The destination server and paths are hardcoded in the workflow file itself (`sft
7979

8080
To include a new plugin or theme in the automated vendor deployment:
8181

82-
**1. Edit [`.github/workflows/deploy-vendors.yml`](.github/workflows/deploy-vendors.yml)** and add two steps following the same pattern as the existing ones.
82+
**1. Edit [`.github/workflows/deploy-vendors.yml`](.github/workflows/deploy-vendors.yml)** and make two changes.
83+
84+
Add a line to the **"Ensure remote vendor directories exist"** step:
85+
86+
```bash
87+
mkdir -fp htdocs/wp-content/plugins/your-package-name/vendor;
88+
```
8389

8490
Add a `composer install` step:
8591

0 commit comments

Comments
 (0)