From 595b69a71f3ccc066b5fb8649941046bf7cb9dad Mon Sep 17 00:00:00 2001 From: Anindra Date: Thu, 3 Dec 2026 01:53:00 +0530 Subject: [PATCH] ci: deploy the compose service from tags via the Dokploy API Dokploy v0.31.7's compose webhook returns Compose Not Found for this service and its handler compares branch names, so a tag push cannot deploy it. Call POST /api/compose.deploy with the compose id and the DOKPLOY_API_KEY repository secret instead. Keep workflow_dispatch so a deploy can be retried without cutting a new tag. --- .github/workflows/deploy.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..9fa8f73 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: Deploy + +on: + push: + tags: + - "v*.*.*" + workflow_dispatch: + +permissions: + contents: read + +jobs: + dokploy: + name: Deploy the compose service + runs-on: ubuntu-26.04 + steps: + - name: Trigger Dokploy compose deploy + env: + DOKPLOY_API_KEY: ${{ secrets.DOKPLOY_API_KEY }} + run: | + if [ -z "$DOKPLOY_API_KEY" ]; then + echo "::error::DOKPLOY_API_KEY is not set; cannot trigger the deployment." + exit 1 + fi + curl -fsS -X POST "https://dokploy.hacksubset.com/api/compose.deploy" \ + -H "x-api-key: $DOKPLOY_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"composeId":"qFd9GlvcRtYr8iYIYNwhl","title":"GitHub tag ${{ github.ref_name }}"}'