deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s

This commit is contained in:
2026-07-04 17:18:58 +03:00
parent c8fc8776fd
commit 7088ab43ad
+6 -7
View File
@@ -89,17 +89,16 @@ jobs:
FAILURE_MESSAGE: |-
❌ <b>Ошибка деплоя!</b>
Релиз: <code>${{ gitea.ref_name }}</code>
DEPLOY_LOG_FILE: /tmp/deploy-${{ env.CLEAN_REF_NAME }}.log
run: |
sshpass -e ssh -p 22 "$SSH_USERNAME@$SSH_HOST" bash -s << EOT
set -e
cd "$DEPLOY_DIRECTORY"
DEPLOY_LOG_FILE="/tmp/deploy-${REF_NAME}.log"
nohup bash -c "
nohup bash -c '
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" \
--proxy "${PROXY_URL}" \
-d "chat_id=${TELEGRAM_CHAT}" \
@@ -115,11 +114,11 @@ jobs:
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \
--proxy "${PROXY_URL}" \
-F "chat_id=${TELEGRAM_CHAT}" \
-F "document=@\$DEPLOY_LOG_FILE" > /dev/null
-F "document=@${DEPLOY_LOG_FILE}" > /dev/null
fi
rm -f \$DEPLOY_LOG_FILE
" > /dev/null 2>&1 &
rm -f ${DEPLOY_LOG_FILE}
' > /dev/null 2>&1 &
EOT
echo "New containers will be started after 5 seconds"