diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf48509..6ff6a76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,4 +76,23 @@ jobs: context: . file: ./Dockerfile push: true - tags: reg.lijue.net:5888/docs/docs:latest \ No newline at end of file + 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 \ No newline at end of file