Изменение .woodpecker.yaml 13
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Konstantin
2026-04-12 20:57:33 +07:00
parent 5e610a3980
commit d7dd806be1

View File

@@ -49,22 +49,28 @@ steps:
# Шаг 3: Очистка кэша на сервере # Шаг 3: Очистка кэша на сервере
- name: flush-cache - name: flush-cache
image: appleboy/drone-ssh image: alpine:latest
settings:
host:
from_secret: PROD_SSH_HOST
username:
from_secret: PROD_SSH_USER
key:
from_secret: PROD_SSH_KEY
envs:
- REMOTE_PATH
script:
- cd $REMOTE_PATH
- if command -v wp > /dev/null 2>&1; then wp cache flush; fi
- touch wp-config.php
environment: environment:
SSH_KEY:
from_secret: PROD_SSH_KEY
SSH_USER:
from_secret: PROD_SSH_USER
SSH_HOST:
from_secret: PROD_SSH_HOST
REMOTE_PATH: REMOTE_PATH:
from_secret: REMOTE_PATH from_secret: REMOTE_PATH
commands:
- apk add --no-cache openssh-client
- mkdir -p ~/.ssh
- echo "$SSH_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts 2>/dev/null
- |
ssh -i ~/.ssh/id_rsa \
-o StrictHostKeyChecking=no \
"$SSH_USER@$SSH_HOST" \
"cd $REMOTE_PATH && \
if command -v wp > /dev/null 2>&1; then wp cache flush; fi && \
touch wp-config.php"
when: when:
branch: main branch: main