Skip to main content
- uses: basetenlabs/action-truss-push@v0.1
  with:
    truss-directory: "./my-model"
    baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
Deploys a Truss model or chain to Baseten, waits for the deployment to become active, optionally validates it with a predict request, and cleans up the deployment. For workflow examples, see CI/CD. Models are detected when truss-directory points to a directory containing config.yaml. Chains are detected when truss-directory points to a .py file containing a @chains.mark_entrypoint class. Pin to a specific release tag. Don’t use @main because the action API may change between releases.

Inputs

truss-directory
string
required
Path to a model directory containing config.yaml, or a .py file for chain deployments.
baseten-api-key
string
required
Baseten API key. Store this as an encrypted secret. Never hardcode it in your workflow file.
model-name
string
default:""
Override the model or chain name. For models, maps to truss push --model-name. For chains, sets the chain_name. If empty, the action uses model_name from config.yaml for models, or the entrypoint class name for chains.
environment
string
default:""
Publish to a specific environment. Implies publish. If empty, no environment is set.
include-git-info
string
default:"true"
Attach git versioning info (SHA, branch, tag) to the deployment.
labels
string
default:""
JSON string of labels as key-value pairs, for example {"team": "ml", "project": "llm"}. Attach metadata to track deployments in your CI pipeline.
deployment-name
string
default:""
Name of the deployment. If empty, defaults to PR-{number}_{sha} on pull requests or {sha} on direct pushes.
cleanup
string
default:"true"
Deactivate the newly created deployment after validation. Useful for PR checks where you deploy, validate with a predict request, and tear down. Set to false when you want the deployment to remain active for manual inspection or when deploying to an environment.
predict-payload
string
default:""
JSON override for the predict request payload. For models, if empty, the action reads model_metadata.example_model_input from config.yaml. For chains, the predict payload must be provided explicitly. If neither is set, the predict step is skipped entirely and the deployment isn’t validated.
deploy-timeout-minutes
string
default:"45"
Maximum minutes to wait for the deployment to become active. The default (45 minutes) accommodates large model builds like TRT-LLM. Reduce this for smaller models to fail faster.
predict-timeout
string
default:"300"
Timeout in seconds for the predict request.

Outputs

deployment-id
string
Baseten deployment ID. Use this to reference the deployment in downstream steps or API calls.
model-id
string
Baseten model ID. Set for model deployments only.
chain-id
string
Baseten chain ID. Set for chain deployments only.
model-name
string
Model or chain name.
deploy-time-seconds
string
Wall-clock seconds from push to active. Useful for tracking build performance over time.
predict-response
string
Response body from the predict call, truncated to 4 KB.
status
string
Final status of the action run. One of: success, deploy_failed, deploy_timeout, predict_failed, cleanup_failed.

Status codes

StatusDescription
successDeployment active, predict passed (if payload configured), cleanup completed.
deploy_failedtruss push or image build failed. Check config.yaml syntax and API key. Build logs appear in collapsible sections in the GitHub Actions output.
deploy_timeoutDeployment didn’t become active within deploy-timeout-minutes. Increase the timeout for large models.
predict_failedPredict request returned an error or timed out. Verify the payload shape matches what the model expects.
cleanup_failedDeployment deactivation failed. The deployment may still be running. Deactivate it manually from the dashboard.

Deployment naming

The action generates deployment names from Git context unless you override with deployment-name:
  • Pull requests: PR-{number}_{short_sha} (for example, PR-42_abc1234).
  • Direct pushes: {short_sha} (for example, abc1234).

Permissions

The action requires only contents: read permission. No additional GitHub token permissions are needed.
permissions:
  contents: read