测试新的ci,触发coolify的部署

This commit is contained in:
2025-08-08 18:01:36 +08:00
parent 3aed750f78
commit f57e410393

View File

@@ -76,4 +76,23 @@ jobs:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
push: true push: true
tags: reg.lijue.net:5888/docs/docs:latest tags: reg.lijue.net:5888/docs/docs:latest
- name: Trigger Coolify deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
COOLIFY_API_URL: https://coolify.lijue.net:5888/api/v1/deploy?uuid=ks44swgo4kc8wgwkwck4s004&force=false
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
run: |
set -euo pipefail
echo "Triggering Coolify deploy: $COOLIFY_API_URL"
http_code=$(curl -sS -w "%{http_code}" -o coolify_response.json -X GET "$COOLIFY_API_URL" \
-H "Authorization: Bearer $COOLIFY_TOKEN" \
-H "Accept: application/json")
echo "HTTP status: $http_code"
echo "Response:"
cat coolify_response.json
if [ "$http_code" -lt 200 ] || [ "$http_code" -ge 400 ]; then
echo "Coolify deploy trigger failed"
exit 1
fi