Files
xkater/.woodpecker.yaml
2026-04-12 18:35:16 +07:00

51 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# .woodpecker.yaml
pipeline:
# Шаг 1: Сборка ассетов темы
build-assets:
image: node:20-alpine
commands:
- cd wp-content/themes/xkater
# Проверяем, есть ли package.json (вдруг вы не используете сборщик)
- if [ -f package.json ]; then npm ci && npm run build; fi
when:
branch: main
# Шаг 2: Деплой на боевой сервер
deploy-production:
image: drillster/drone-rsync
settings:
user: ${PROD_SSH_USER}
host: ${PROD_SSH_HOST}
key: ${PROD_SSH_KEY}
source: ./wp-content/
target: ${REMOTE_PATH}/wp-content/
recursive: true
delete: false # ← ВАЖНО: не удалять то, чего нет в репозитории
args: >
--exclude=uploads/
--exclude=plugins/akismet/
--exclude=plugins/index.php
--exclude=.git/
--exclude=node_modules/
--exclude=.DS_Store
--exclude=mu-plugins/local-dev-performance.php
when:
branch: main
# Шаг 3: Очистка кэша на сервере
flush-cache:
image: appleboy/drone-ssh
settings:
host: ${PROD_SSH_HOST}
username: ${PROD_SSH_USER}
key: ${PROD_SSH_KEY}
script:
- cd ${REMOTE_PATH}
# Очистка кэша WordPress (если есть WP-CLI)
- if command -v wp &> /dev/null; then wp cache flush; fi
# Или просто трогаем wp-config.php для сброса кэша опкодов
- touch wp-config.php
when:
branch: main
status: success