Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

deploy-enterprise.yml 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Deploy Enterprise
  2. permissions:
  3. contents: read
  4. on:
  5. workflow_run:
  6. workflows: ["Build and Push API & Web"]
  7. branches:
  8. - "deploy/enterprise"
  9. types:
  10. - completed
  11. jobs:
  12. deploy:
  13. runs-on: ubuntu-latest
  14. if: |
  15. github.event.workflow_run.conclusion == 'success' &&
  16. github.event.workflow_run.head_branch == 'deploy/enterprise'
  17. steps:
  18. - name: trigger deployments
  19. env:
  20. DEV_ENV_ADDRS: ${{ vars.DEV_ENV_ADDRS }}
  21. DEPLOY_SECRET: ${{ secrets.DEPLOY_SECRET }}
  22. run: |
  23. IFS=',' read -ra ENDPOINTS <<< "${DEV_ENV_ADDRS:-}"
  24. BODY='{"project":"dify-api","tag":"deploy-enterprise"}'
  25. for ENDPOINT in "${ENDPOINTS[@]}"; do
  26. ENDPOINT="$(echo "$ENDPOINT" | xargs)"
  27. [ -z "$ENDPOINT" ] && continue
  28. API_SIGNATURE=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$DEPLOY_SECRET" | awk '{print "sha256="$2}')
  29. curl -sSf -X POST \
  30. -H "Content-Type: application/json" \
  31. -H "X-Hub-Signature-256: $API_SIGNATURE" \
  32. -d "$BODY" \
  33. "$ENDPOINT"
  34. done