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