Изменение .woodpecker.yaml 5
This commit is contained in:
@@ -12,38 +12,42 @@ steps:
|
||||
# Шаг 2: Деплой на боевой сервер
|
||||
- name: deploy-production
|
||||
image: drillster/drone-rsync
|
||||
secrets:
|
||||
- source: prod_ssh_user
|
||||
target: RSYNC_USER
|
||||
- source: prod_ssh_host
|
||||
target: RSYNC_HOSTS
|
||||
- source: prod_ssh_key
|
||||
target: RSYNC_KEY
|
||||
- source: remote_path
|
||||
target: REMOTE_PATH
|
||||
settings:
|
||||
user: ${PROD_SSH_USER}
|
||||
hosts:
|
||||
- ${PROD_SSH_HOST}
|
||||
port: 22
|
||||
key: ${PROD_SSH_KEY}
|
||||
source: ./wp-content/
|
||||
target: ${REMOTE_PATH}/wp-content/
|
||||
target:
|
||||
from_secret: remote_path # либо прописать путь вручную
|
||||
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
|
||||
args: '--exclude=uploads/ --exclude=plugins/akismet/ --exclude=.git/ --exclude=node_modules/ --exclude=.DS_Store'
|
||||
when:
|
||||
branch: main
|
||||
|
||||
# Шаг 3: Очистка кэша на сервере
|
||||
# Шаг 3: Очистка кэша
|
||||
- name: flush-cache
|
||||
image: appleboy/drone-ssh
|
||||
secrets:
|
||||
- source: prod_ssh_host
|
||||
target: SSH_HOST
|
||||
- source: prod_ssh_user
|
||||
target: SSH_USERNAME
|
||||
- source: prod_ssh_key
|
||||
target: SSH_KEY
|
||||
- source: remote_path
|
||||
target: REMOTE_PATH
|
||||
settings:
|
||||
host: ${PROD_SSH_HOST}
|
||||
username: ${PROD_SSH_USER}
|
||||
key: ${PROD_SSH_KEY}
|
||||
script:
|
||||
- cd ${REMOTE_PATH}
|
||||
- if command -v wp &> /dev/null; then wp cache flush; fi
|
||||
- cd $REMOTE_PATH
|
||||
- if command -v wp > /dev/null 2>&1; then wp cache flush; fi
|
||||
- touch wp-config.php
|
||||
when:
|
||||
branch: main
|
||||
# Убрали status - он не нужен для этого шага
|
||||
|
||||
Reference in New Issue
Block a user