Hubfly spaceDocs
Console

Deployment pipelines

A deployment pipeline webhook is an incoming HTTP endpoint for a Hubfly space project. Your CI provider calls it after a build or image publication, and Hubfly space performs the selected action for one container or for the container named in the request.

A push does not redeploy by itself

Publishing a new image tag does not automatically replace a running container. Call a deployment webhook or start the deployment from the Dashboard after the image is available.

How deployment webhooks work

  1. Create a webhook in the project Dashboard and select its target and allowed actions.
  2. Copy the generated URL and, for Secure mode, the signing secret. The secret is shown only once.
  3. Store those values in your CI provider's encrypted secrets.
  4. Send a JSON request after the image or Git source is ready.
  5. Open the project's Deployments view to inspect the resulting event and any error.

Create a webhook

In the Dashboard, open Project → Deployments → Pipeline Console and chooseRegister Webhook. Configure these fields:

FieldWhat it controls
NameA label used to identify the webhook in the Dashboard.
DescriptionOptional note such as production GitHub Actions.
Target containerSelect one container, or leave it project-scoped and provide containerId in every request.
ModeHow Hubfly space authenticates the incoming request.
Allowed actionsThe operations this endpoint may perform: pull, create, update, restart, rollback, or delete.
IP allowlistOptional source IP restriction for callers such as fixed CI runners.

Choose an authentication mode

ModeRequest authenticationBest for
basicA token embedded in the generated URL. The Dashboard limits this mode to pull.Temporary or low-risk internal testing.
standardA token embedded in the generated URL. The Dashboard offers pull, create, and restart.Simple CI integrations where URL-token authentication is acceptable.
secureNo token in the URL. Sign the timestamp and exact raw request body with HMAC-SHA256.Production deployments and any integration that can calculate HMAC signatures.

Treat generated credentials as secrets

The raw token or Secure-mode secret is returned only when the webhook is created. If it is lost, create a replacement webhook and remove the old one. Do not put a tokenized URL in a public repository, issue, or build log.

Call the endpoint

Use the exact generated URL from the Dashboard. Its path has one of these shapes:

text
# Basic or Standard mode (the generated URL includes TOKEN)
POST https://api.hubfly.space/api/webhooks/deploy/WEBHOOK_ID/TOKEN

# Secure mode (the generated URL has no token)
POST https://api.hubfly.space/api/webhooks/deploy/WEBHOOK_ID

Basic and Standard requests authenticate with the token in the URL path. Secure requests must include both headers below. The signature is calculated over TIMESTAMP.rawBody, including the dot, and the timestamp must be within five minutes of Hubfly space's clock.

text
X-Hub-Timestamp: 1710000000
X-Hub-Signature-256: sha256=<64 hexadecimal characters>

Request payloads

JSON field names are case-sensitive. An empty body defaults to a pull action. A project-scoped webhook must include containerId; a webhook already attached to a container does not need it.

Pull an image or Git source

json
{
  "action": "pull",
  "containerId": "container_123",
  "image": "ghcr.io/acme/api:v2.4.0"
}

For a Git-backed container, use ref (or branch) and optionallycommitSha (or commit) instead of image:

json
{
  "action": "pull",
  "ref": "main",
  "commitSha": "7f3b1a9"
}

Update runtime configuration

The update action can include a new image and supported container settings. The example uses the top-level aliases accepted by the webhook parser; nestedcontainer, spec, and update objects are also accepted.

json
{
  "action": "update",
  "image": "ghcr.io/acme/api:v2.4.0",
  "environment": {
    "APP_ENV": "production",
    "LOG_LEVEL": "info"
  },
  "restartPolicy": "unless-stopped"
}

Restart or roll back

json
{ "action": "restart" }

{ "action": "rollback" }

Rollback is an explicit action. If you configure rollback options for an update, you can also send rollback.enabled, rollback.onHealthCheckFail, and a positiverollback.timeoutSeconds. Inspect the deployment event to confirm whether the requested action succeeded; rollback is not a guarantee that every failed deployment has a previous version available.

GitHub Actions example

Add HUBFLY_WEBHOOK_URL and, for Secure mode, HUBFLY_WEBHOOK_SECRET as GitHub Actions secrets. This workflow signs the exact body sent with curl:

yaml
name: Deploy to Hubfly space
on:
  push:
    branches: [ main ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Hubfly space deployment
        env:
          HUBFLY_WEBHOOK_URL: ${{ secrets.HUBFLY_WEBHOOK_URL }}
          HUBFLY_WEBHOOK_SECRET: ${{ secrets.HUBFLY_WEBHOOK_SECRET }}
          COMMIT_SHA: ${{ github.sha }}
        run: |
          body=$(printf '{"action":"pull","ref":"main","commitSha":"%s"}' "$COMMIT_SHA")
          timestamp=$(date +%s)
          signature=$(printf '%s.%s' "$timestamp" "$body" |             openssl dgst -sha256 -hmac "$HUBFLY_WEBHOOK_SECRET" -hex | sed 's/^.* //')

          curl --fail-with-body -X POST "$HUBFLY_WEBHOOK_URL"             -H 'Content-Type: application/json'             -H "X-Hub-Timestamp: $timestamp"             -H "X-Hub-Signature-256: sha256=$signature"             --data "$body"

Use the commit SHA for reproducible deployments

Build and publish an immutable tag such as sha-7f3b1a9, then send that tag or the Git commit SHA in the webhook payload. This makes it clear which artifact the deployment used and avoids relying on a moving latest tag.

Monitor and troubleshoot

View the project's Deployments or Pipeline Console to see the action, trigger, status, duration, target container, and error details for each deployment event. The API can list the same project deployment history with GET /api/v1/projects/:projectId/deployments.

SymptomLikely causeWhat to check
401Missing or incorrect URL token.Copy the complete Basic/Standard URL again; never add a token to a Secure URL.
400 on Secure modeMalformed signature, stale timestamp, or body changed after signing.Sign timestamp.rawBody and send the same raw bytes in the request.
403The action is not allowed or the caller IP is not allowlisted.Review Allowed actions and IP allowlist settings in the Dashboard.
Container is missingA project-scoped webhook was called without containerId.Include the target container ID in the JSON body.
Image was pushed but nothing changedRegistry publication does not trigger a deployment.Call the deployment webhook with {"action":"pull"} or redeploy from the Dashboard.
Deployment failedImage, source, runtime, or health-check issue.Open the deployment event, verify the image reference and container health settings, then retry or explicitly roll back.

For registry event notifications, use Registry webhooks. For endpoint schemas and response examples, see the API reference.

Something unclear or out of date? Emailsupport@hubfly.spaceBack to top