Skip to main content
Connecting a repository creates a Shipyard project that watches a branch for pushes. When new commits arrive, the CI engine clones, builds, and deploys your code automatically. This guide walks through each step from OAuth authentication to webhook registration.
1

Authenticate with GitHub

Navigate to GET /api/auth/github in your browser. Shipyard redirects you to GitHub’s OAuth consent screen requesting the read:user, repo, and read:org scopes. After you approve, GitHub redirects back to the callback endpoint and Shipyard issues a JWT. Store this token — every subsequent API call requires it in the Authorization: Bearer <token> header.
2

Browse your organizations

Call GET /api/repo/orgs to retrieve a list of your GitHub organizations and personal account. The response includes each account’s login name, which you’ll use to list repositories in the next step.
3

List repositories

Call GET /api/repo/repos with the org and page query parameters to paginate through repositories for a given account. Results are sorted by creation date (newest first) and filtered to repos you own.
Each result includes the repository name, default branch, HTTPS URL, and owner — everything you need to create the project.
4

Create the project

Send a POST /api/project request with the repository details and any build configuration. Shipyard validates the inputs, registers a webhook on the repo, inserts the project record, and immediately queues an initial build from the latest commit on the configured branch.
A successful response returns 201 with the project record and the ID of the initial build.
5

Webhook registered automatically

Shipyard calls the GitHub API on your behalf to register a push-event webhook on the repository. The webhook ID is stored against the project record so Shipyard can remove it if you later delete the project. From this point forward, any push to the configured branch triggers a new build — no manual setup required.

Project fields

The project name must be unique per user. It becomes the subdomain at which your project is served, for example https://my-frontend.yourdomain.com. Choose a name that is URL-safe and does not conflict with existing projects.