How to connect your GitHub repository and deploy automatically
Method 1 — GitHub integration (automatic)
GitHub authentication connects your account directly to the repository, with no need to create manual tokens. When you install our app, you grant secure access only to the repositories you choose and keep full control from GitHub itself, and you can revoke access at any time.
Step 1: Connect your GitHub account
- Open the Square Cloud dashboard and go to My account → Connections.
- In the GitHub section, click Connect and authorize the Square Cloud app (OAuth flow).
- Choose to grant access to all repositories or only selected repositories and confirm the installation.
Step 2: Choose the repository and branch in your application
- Open the desired application in the dashboard and go to the Deploys tab.
- In the Deploy via GitHub block, make sure the selected method is Automatic.
- Under GitHub integration, select the account or organization in the left selector and use the Search for a repository... field to find the repository.
- Click the repository in the list to select it (a check mark appears next to it).
- On the right panel, check the Language and Size and choose the Branch you want (for example,
main). - Click Select repository to save.
Ready! From now on, every push to the configured branch triggers a new deploy automatically.
Method 2 — Webhook integration (manual)
Use this method if you prefer not to connect your account via OAuth. Here you generate a personal access token on GitHub and set up the webhook manually in the repository.
Step 1: Generate the access token on GitHub
- On GitHub, go to Settings → Developer settings → Personal access tokens → Tokens (classic).
- Click Generate new token (classic).
- Under permissions, select only the
reposoption. - Do not set an expiration date, to avoid future deploy interruptions.
- Click Generate token and copy it immediately — once you leave the page you won't be able to see it again.
Step 2: Set up the token on Square Cloud
- Open the dashboard and go to your application.
- Go to the Deploys tab.
- Paste the token in the indicated field and click Save.
- Copy the webhook URL that appears.
Step 3: Set up the webhook on GitHub
- In the repository, go to Settings → Webhooks → Add Webhook.
- Paste the copied URL in the Payload URL field.
- Set the Content Type to
application/json. - Click Add Webhook to confirm.
Step 4: Target a specific branch (optional)
By default, the webhook tracks the main branch. To watch another branch, add the ?branch=branch_name parameter to the end of the Payload URL — for example, ...webhook?branch=main.
Testing the integration
Push to the repository, on the configured branch, and watch the deploy logs in the application dashboard. If the deploy starts on its own, the integration is working.
FAQ
Which method should I use? GitHub integration (automatic) is the recommended and current default — simpler, with no manual tokens. Use the Webhook only if you need a manual setup.
Do I need to set up both methods? No. Choose only one per application.
How do I change the branch later? With the automatic method, go back to the Deploys tab and select another branch. With the webhook method, adjust the ?branch= parameter in the Payload URL.
Updated on: 07/11/2026
Thank you!
