fix: ci — inline theme path in SSH verify step (was using undefined remote var)

The 'Verify deploy destination' step defined DEST on the runner then used
${DEST} inside an SSH command. The remote shell has no DEST variable, so
${DEST} expanded to empty → 'test -f /style.css' → always fails.

Fix: inline the full theme path using ${{ secrets.SSH_USERNAME }} which
the GitHub Actions runner expands to a literal string before the script
is sent to SSH. Remote shell receives a plain path with no variables.
This commit is contained in:
peptiderepo
2026-04-26 05:22:12 +00:00
parent 95985d5d30
commit e4bf5faf5b

View File

@@ -90,10 +90,10 @@ jobs:
ssh-keyscan -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts 2>/dev/null || true
- name: Verify deploy destination is a theme directory
run: |
DEST="/home/${{ secrets.SSH_USERNAME }}/domains/peptiderepo.com/public_html/wp-content/themes/peptide-starter"
# Path verified inline below using ${{ }} runner expansion
ssh -i ~/.ssh/deploy_key -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=accept-new \
${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} \
"test -f \"\${DEST}/style.css\" || { echo \"ERROR: \${DEST}/style.css not found — aborting deploy to prevent rsync --delete wiping wrong directory\"; exit 1; }"
"test -f '/home/${{ secrets.SSH_USERNAME }}/domains/peptiderepo.com/public_html/wp-content/themes/peptide-starter/style.css' || { echo 'ERROR: style.css not found at theme path — aborting deploy'; exit 1; }"
- name: Snapshot plugin inventory (pre-deploy)
run: |
ssh -i ~/.ssh/deploy_key -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=accept-new \