ArxDeck
Integrations

Custom deployments (GitHub Actions)

Run your own provision and deploy workflows per work track with ArxDeck lifecycle hooks.

Custom deployments (GitHub Actions)

Use custom Publish mode when managed Railway hosting cannot model your stack (multiple services, databases, buckets, or non-standard infra). ArxDeck dispatches your GitHub Actions workflow on work-track lifecycle events and records status from your workflow callbacks.

Managed standard and static modes remain on platform hosting with branded *.app.arxdeck.ai URLs. Custom mode uses URLs you report in callbacks (no automatic ArxDeck hostname).

Prerequisites

  • Project GitHub linked and reachable
  • A workflow under .github/workflows/ with a workflow_dispatch trigger
  • Project admin access to approve Publish configuration proposals

Enable custom mode

  1. Open Settings → Publish.
  2. Approve a switch_deployment_mode proposal (via Proposals or ArxDeck Helper) with targetMode: custom and your workflow path.
  3. Store the generated callback secret in GitHub Actions secrets (name documented in Publish after enable). Publish can sync only this secret to GitHub.
  4. Configure the publish env var catalog in Publish settings. Values stay in ArxDeck; your workflow loads them at job start via OIDC (below). Do not copy catalog secrets into workflow_dispatch inputs.

Publish env vars (OIDC hydrate)

ArxDeck holds publish env vars (catalog defaults + per-track overrides). In custom mode, jobs fetch the effective map for the track branch over HTTPS using a GitHub Actions OIDC ID token — no long-lived fetch token in the repo.

API: GET {APP_URL}/api/deployments/custom/{projectId}/publish-env

  • Header: Authorization: Bearer <GitHub Actions ID token>
  • Audience (aud when requesting the token): your ArxDeck control-plane URL (same origin as APP_URL, no trailing slash), unless your operator documents an override.
  • Track selection: the token’s ref (branch the job runs on) must match an active work track branch. ArxDeck does not trust track slug from dispatch inputs or query parameters.
  • Untrusted contexts (e.g. fork pull_request workflows) are denied.
  • Omit keys with no effective value (same as catalog resolution in the dashboard).

Supported workflow pattern (required): use the official composite action (copy into your repo or reference ArxDeck’s):

permissions:
  id-token: write
  contents: read

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ inputs.arxdeck_branch }}
      - name: Hydrate publish env from ArxDeck
        uses: ./.github/actions/arxdeck-hydrate-publish-env
        with:
          publish-env-url: ${{ inputs.arxdeck_publish_env_url }}
          oidc-audience: ${{ inputs.arxdeck_oidc_audience }}  # sent by ArxDeck; or vars / ARXDECK_APP_URL fallback

The hydrate step masks every value with ::add-mask:: before writing to GITHUB_ENV. Do not echo response bodies on failure or use ad-hoc curl without the same masking discipline.

Operator-owned secrets (e.g. Railway tokens) that are not in the publish catalog remain normal GitHub Actions secrets you manage yourself. When a catalog value is present, it overrides the GitHub secret after hydrate. Railway Not Authorized in track workflows usually means the token or workspace ID is wrong — see track environments operations.

Workflow dispatch inputs

ArxDeck sends these workflow_dispatch inputs:

InputDescription
arxdeck_actionprovision, update, or destroy
arxdeck_run_idDeployment run id (for callbacks)
arxdeck_environment_idTrack environment id
arxdeck_track_idWork track id
arxdeck_project_idProject id
arxdeck_branchGit branch for the track
arxdeck_commit_shaCommit SHA when known (may be empty)
arxdeck_track_slugWork track slug (environment key for deploy record API)
arxdeck_record_urlHTTPS URL for POST …/record only (same auth as callback). Status callbacks use sibling POST …/callback — do not append /callback to this input (${arxdeck_record_url%/record}/callback in bash).
arxdeck_publish_env_urlHTTPS URL for GET …/publish-env (OIDC auth; URL only)
arxdeck_oidc_audienceOIDC token audience (control plane URL); matches ArxDeck BETTER_AUTH_URL / PUBLISH_ENV_OIDC_AUDIENCE
arxdeck_app_urlOperator / dogfood only: dispatching control plane origin for scoped orphan reconcile
arxdeck_repoOperator / dogfood only: bound GitHub repo owner/name for scoped orphan reconcile

The reconcile action is not part of the generic customer lifecycle. ArxDeck operator dogfood dispatches it from the control plane for scoped Railway track orphan cleanup; customer workflows should implement only provision, update, and destroy.

Callback API

POST {APP_URL}/api/deployments/custom/{projectId}/callback — a sibling of the record URL ArxDeck passes as arxdeck_record_url, not a path under /record.

Header: Authorization: Bearer <callback secret>

JSON body:

{
  "runId": "<arxdeck_run_id>",
  "environmentId": "<arxdeck_environment_id>",
  "status": "in_progress | live | failed | destroyed | completed",
  "previewUrl": "https://your-preview.example.com",
  "failureReason": "optional",
  "logExcerpt": "optional redacted text"
}

For web previews, report previewUrl when status is live. That URL appears in Publish, work tracks, and MCP as the environment link.

Callback secret (GitHub Actions)

ArxDeck generates a per-project callback secret for POST …/callback and POST …/record.

Recommended (OIDC): After hydrating publish env from GET …/publish-env, your job receives ARXDECK_DEPLOY_CALLBACK_SECRET in the environment (masked). This avoids a single repo-global GitHub secret when multiple ArxDeck projects share one repository (e.g. staging vs production control planes).

Optional fallback: Store the same name as a GitHub Actions secret (ARXDECK_DEPLOY_CALLBACK_SECRET). Publish can sync it when the GitHub App has Secrets write access.

On Publish → Rotate callback secret, ArxDeck issues a new value; the next OIDC hydrate picks it up automatically. GitHub sync remains optional for workflows without hydrate.

When a deploy finishes at a new live commit, ArxDeck also records deploy tracking internally if the run has a source revision (managed standard/static paths). Custom workflows should call the record API below when your job is the source of truth for live SHA.

Record deployment API (v1, forward-only)

POST {APP_URL}/api/deployments/custom/{projectId}/record

Same header as callback: Authorization: Bearer <callback secret>

JSON body:

{
  "trackSlug": "production",
  "oldLiveSha": "abc123…",
  "newLiveSha": "def456…",
  "builtAt": "2026-11-01T14:00:00.000Z",
  "buildUrl": "https://optional-ci.example/run/1",
  "commits": ["def456…", "111…"]
}
  • trackSlug — active work track slug (production, staging, or a custom track slug).
  • oldLiveSha — previous live commit on that track, or null on first deploy.
  • commits — optional; every commit SHA in the deploy (git rev-list "$OLD_SHA..$NEW_SHA", full 40-character SHAs). Only accepted together with oldLiveSha. When omitted, ArxDeck lists the range through GitHub. PRs merged into this track whose merge commit (merge, squash, or rebase) is in the range are marked deployed.
  • Idempotent: repeating the same newLiveSha for a track is a no-op.
  • Rollback is not supported in v1; live must move forward (oldLiveSha must match stored live when present).

Example after a successful deploy job:

curl -sS -X POST "$ARXDECK_RECORD_URL" \
  -H "Authorization: Bearer $ARXDECK_CALLBACK_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "trackSlug": "'"$ARXDECK_TRACK_SLUG"'",
    "oldLiveSha": "'"$OLD_SHA"'",
    "newLiveSha": "'"$NEW_SHA"'",
    "builtAt": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
  }'

Ticket PR rows and Deploy status on ticket detail update from this data (no workflow status changes). A track also inherits PRs from its base tracks that merged there before it forked. Project admins can run Reconcile under Publish → Deploy tracking to rebuild deploy status from git history (for example after a rollback or for deploys before tracking was enabled).

Lifecycle

  • Track provision — dispatches provision when enabled in settings
  • Push / Deploy now — dispatches update when auto-deploy or manual deploy runs
  • Track close — dispatches destroy when teardown on close is enabled

Ephemeral agent previews

When enabled in Publish → Custom settings, ArxDeck provisions a dedicated ephemeral work track (hidden from ticket/chat pickers) and dispatches a second workflow path for agent-scoped previews.

  • Enabling ephemeral builds validates the workflow in GitHub first; if validation fails, settings are not saved and the ephemeral track is not created.
  • On Publish → Work tracks, the ephemeral track shows publish env vars and deployment history only (no manual deploy, auto-deploy, destroy, or health-check actions for that track).
  • Configure ephemeral workflow path, lease TTL, max concurrent ephemeral runs, and release policy (agent complete, agent complete with MCP PR, or MCP-linked PR merged).
  • Ticket agents, scheduled-task agents, and project chat can call MCP ephemeral_build (launch, update, reset-db, release, destroy, status) with a branch (and optional commit). For launch, update, and reset-db, the tool waits until the deployment run finishes and returns previewUrl, outputs, status, and runId (no separate polling). launch restores the ephemeral DB snapshot and rotates preview bot credentials (arxdeckBot1 / arxdeckBot2 output keys); reset-db does the same; update syncs code only. Previews stick to an ephemeral session (same agent on the same ticket, scheduled task, or conversation reuses a warm slot across runs). release and destroy dispatch without waiting.
  • Ephemeral workflow must declare arxdeck_ephemeral_session_id (required). Optionally keep arxdeck_agent_run_id / arxdeck_chat_run_id for audit.
  • Publish-env OIDC: use the dispatch input arxdeck_publish_env_url (includes ?scope=ephemeral&runId=…); track branch matching is not required for ephemeral scope.
  • Callback may include optional outputs JSON (sanitized keys/values) in addition to previewUrl.

Copy the reference workflow and hydrate composite from this repository’s docs/examples/ (arxdeck-ephemeral-preview.yml.example and arxdeck-hydrate-publish-env/action.yml). Those files are documentation templates only (not under .github/workflows/, so they do not run in CI). The template shows OIDC publish-env hydrate (::add-mask:: + GITHUB_ENV) and a later step using ARXDECK_DEPLOY_CALLBACK_SECRET for POST …/callback.

MCP

  • Read: get_deployment_status, get_deployment_run_logs
  • ephemeral_build when ephemeral previews are enabled (not limited to ticket agent runs; chat supported)
  • Mode changes and custom settings: propose_deployment_config with switch_deployment_mode or update_custom_deploy_config

The standalone propose_deployment_mode_migration tool was removed; use deployment config proposals instead.