测试新的ci,触发coolify的部署
This commit is contained in:
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
@@ -77,3 +77,22 @@ jobs:
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
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
|
Reference in New Issue
Block a user