mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 12:37:20 +08:00
Feat/enteprise cd (#25485)
This commit is contained in:
parent
70e4d6be34
commit
34e55028ae
28
.github/workflows/deploy-enterprise.yml
vendored
28
.github/workflows/deploy-enterprise.yml
vendored
@ -19,11 +19,23 @@ jobs:
|
|||||||
github.event.workflow_run.head_branch == 'deploy/enterprise'
|
github.event.workflow_run.head_branch == 'deploy/enterprise'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy to server
|
- name: trigger deployments
|
||||||
uses: appleboy/ssh-action@v0.1.8
|
env:
|
||||||
with:
|
DEV_ENV_ADDRS: ${{ vars.DEV_ENV_ADDRS }}
|
||||||
host: ${{ secrets.ENTERPRISE_SSH_HOST }}
|
DEPLOY_SECRET: ${{ secrets.DEPLOY_SECRET }}
|
||||||
username: ${{ secrets.ENTERPRISE_SSH_USER }}
|
run: |
|
||||||
password: ${{ secrets.ENTERPRISE_SSH_PASSWORD }}
|
IFS=',' read -ra ENDPOINTS <<< "$DEV_ENV_ADDRS"
|
||||||
script: |
|
|
||||||
${{ vars.ENTERPRISE_SSH_SCRIPT || secrets.ENTERPRISE_SSH_SCRIPT }}
|
for ENDPOINT in "${ENDPOINTS[@]}"; do
|
||||||
|
ENDPOINT=$(echo "$ENDPOINT" | xargs)
|
||||||
|
|
||||||
|
BODY=$(cat <<EOF
|
||||||
|
{
|
||||||
|
"project": "dify-api",
|
||||||
|
"tag": "deploy-enterprise"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
API_SIGNATURE=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$DEPLOY_SECRET" | awk '{print "sha256="$2}')
|
||||||
|
curl -X POST -H "Content-Type: application/json" -H "X-Hub-Signature-256: $API_SIGNATURE" -d "$BODY" "$ENDPOINT"
|
||||||
|
done
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user