Skip to content

Commit 0d3b984

Browse files
rpgmemclaude
andauthored
chore(deploy): exclude dev tooling and repo docs from testes deploy (#392)
User reported finding dev-only files on the testes server after the first successful deploy. Categories cleaned up: Repo metadata: - .githooks/, .distignore Build / dependency manifests: - composer.json, composer.lock, package.json, package-lock.json Static analysis / testing tools: - phpstan-stubs.php, patchwork.json Lint configs (the existing `.eslintrc*` pattern doesn't match ESLint v9 flat config naming `eslint.config.{js,mjs,cjs}` — added the flat pattern explicitly): - eslint.config.* Repo docs (live on GitHub, not in plugin runtime): - CONTRIBUTING.md, SECURITY.md Intentionally kept (per user preference): CHANGELOG.md — useful for historical lookup via SSH; not surfaced to end users (WP.org parses `readme.txt`'s own changelog section). The previous "composer.json e package.json são intencionalmente enviados" rationale was hand-wavy (managed hosting admins might inspect them) and the user disagreed in practice. Comment block rewritten to reflect the new policy. Next push to develop triggers a redeploy; rsync `--delete` will remove the listed files from the testes server in the same pass. Co-authored-by: Claude <noreply@anthropic.com>
1 parent bc4370f commit 0d3b984

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/deploy-develop.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,24 @@ jobs:
6565
# - VCS / CI metadata que não pertence ao runtime do plugin.
6666
# - Dependências de dev (composer require-dev only, node_modules).
6767
# - Testes e ferramentas de análise estática.
68-
# - Configurações locais (wp-config-local.php).
68+
# - Manifests de build/lint (composer.json, package.json e locks
69+
# não servem runtime do WordPress; analisadores externos não
70+
# precisam deles na pasta do plugin em produção).
71+
# - Docs de repositório (CONTRIBUTING.md, SECURITY.md) que vivem
72+
# no GitHub e não no runtime. `CHANGELOG.md` é mantido por
73+
# preferência — consulta histórica via SSH.
6974
# - Saídas de coverage / build intermediário.
70-
# `composer.json` e `package.json` são intencionalmente
71-
# *enviados* — admins de hospedagem gerenciada às vezes os
72-
# inspecionam pra entender o que está rodando.
7375
# `StrictHostKeyChecking=accept-new`: TOFU — aceita a chave do
7476
# host na primeira conexão e exige match em conexões futuras.
7577
# Mais seguro que `no` (vulnerável a MITM); funciona quando o
7678
# `ssh-keyscan` acima falhou silenciosamente.
7779
rsync -avz --delete \
7880
--exclude='.git/' \
7981
--exclude='.github/' \
82+
--exclude='.githooks/' \
8083
--exclude='.gitignore' \
8184
--exclude='.gitattributes' \
85+
--exclude='.distignore' \
8286
--exclude='vendor/' \
8387
--exclude='node_modules/' \
8488
--exclude='tests/' \
@@ -91,12 +95,21 @@ jobs:
9195
--exclude='phpunit.xml.dist' \
9296
--exclude='phpstan.neon' \
9397
--exclude='phpstan.neon.dist' \
98+
--exclude='phpstan-stubs.php' \
9499
--exclude='phpcs.xml' \
95100
--exclude='phpcs.xml.dist' \
101+
--exclude='patchwork.json' \
96102
--exclude='.eslintrc*' \
103+
--exclude='eslint.config.*' \
97104
--exclude='.stylelintrc*' \
98105
--exclude='vitest.config.*' \
106+
--exclude='composer.json' \
107+
--exclude='composer.lock' \
108+
--exclude='package.json' \
109+
--exclude='package-lock.json' \
99110
--exclude='CLAUDE.md' \
111+
--exclude='CONTRIBUTING.md' \
112+
--exclude='SECURITY.md' \
100113
--exclude='html/' \
101114
-e "ssh -i ~/.ssh/deploy_key -p $PORT -o StrictHostKeyChecking=accept-new" \
102115
./ "${SSH_USER}@${SSH_HOST}:${REMOTE_PATH}/"

0 commit comments

Comments
 (0)