Skip to main content
client.apps.deploys connects an app to GitHub so a push deploys it. There are two ways to do it: a webhook that you add to the repository, or the Square Cloud GitHub App. Examples use the client from Creating the client. app_id is the id of one of your apps: client.account.me() lists them.

Webhook

deploys.set_webhook(app_id, access_token) configures GitHub webhook deploys with a GitHub access token (ghp_... or github_pat_...) and returns the webhook URL to add to your repository.
Pass "@" as the token to remove the webhook. The method then returns ''.
An invalid token is 400 INVALID_ACCESS_TOKEN.

GitHub App

deploys.link_github_app(app_id, repository, branch) links a repository installed through the Square Cloud GitHub App. It needs the apps:deploy scope.
deploys.unlink_github_app(app_id) removes the link. To link another repository or branch, unlink first.
Link and unlink share a limit of 3 calls per 60 seconds.

Current configuration

deploys.current(app_id) returns what is configured: app for the GitHub App link, webhook for the webhook URL. It returns {} when nothing is set.

Deploy history

deploys.list(app_id) returns one timeline per deploy, each a list of events, oldest event first. Only Git deploys (webhook and GitHub App pushes) are recorded.

Next steps

Network

Analytics, DNS, custom domains and cache.

Deploy API reference

The REST endpoints behind these methods.

GitHub deploys from the CLI

The same actions from the terminal.