deploy on gitea workflow #3
@@ -89,17 +89,16 @@ jobs:
|
|||||||
FAILURE_MESSAGE: |-
|
FAILURE_MESSAGE: |-
|
||||||
❌ <b>Ошибка деплоя!</b>
|
❌ <b>Ошибка деплоя!</b>
|
||||||
Релиз: <code>${{ gitea.ref_name }}</code>
|
Релиз: <code>${{ gitea.ref_name }}</code>
|
||||||
|
DEPLOY_LOG_FILE: /tmp/deploy-${{ env.CLEAN_REF_NAME }}.log
|
||||||
run: |
|
run: |
|
||||||
sshpass -e ssh -p 22 "$SSH_USERNAME@$SSH_HOST" bash -s << EOT
|
sshpass -e ssh -p 22 "$SSH_USERNAME@$SSH_HOST" bash -s << EOT
|
||||||
set -e
|
set -e
|
||||||
cd "$DEPLOY_DIRECTORY"
|
cd "$DEPLOY_DIRECTORY"
|
||||||
|
|
||||||
DEPLOY_LOG_FILE="/tmp/deploy-${REF_NAME}.log"
|
nohup bash -c '
|
||||||
|
|
||||||
nohup bash -c "
|
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
if docker compose --dry-run -f "docker-compose-${REF_NAME}.yml" up -d --remove-orphans > \$DEPLOY_LOG_FILE 2>&1; then
|
if docker compose --dry-run -f "docker-compose-${REF_NAME}.yml" up -d --remove-orphans > ${DEPLOY_LOG_FILE} 2>&1; then
|
||||||
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
|
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
|
||||||
--proxy "${PROXY_URL}" \
|
--proxy "${PROXY_URL}" \
|
||||||
-d "chat_id=${TELEGRAM_CHAT}" \
|
-d "chat_id=${TELEGRAM_CHAT}" \
|
||||||
@@ -115,11 +114,11 @@ jobs:
|
|||||||
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \
|
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \
|
||||||
--proxy "${PROXY_URL}" \
|
--proxy "${PROXY_URL}" \
|
||||||
-F "chat_id=${TELEGRAM_CHAT}" \
|
-F "chat_id=${TELEGRAM_CHAT}" \
|
||||||
-F "document=@\$DEPLOY_LOG_FILE" > /dev/null
|
-F "document=@${DEPLOY_LOG_FILE}" > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f \$DEPLOY_LOG_FILE
|
rm -f ${DEPLOY_LOG_FILE}
|
||||||
" > /dev/null 2>&1 &
|
' > /dev/null 2>&1 &
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
echo "New containers will be started after 5 seconds"
|
echo "New containers will be started after 5 seconds"
|
||||||
Reference in New Issue
Block a user