Link your GitHub or GitLab account
Link a GitHub or GitLab user to your Nextify account, then create instances from its repositories, private ones included. Nextify adds a read-only deploy key to the repository for you. How to link, pick a repository, disconnect and revoke access.
If your code is on GitHub or GitLab, you can link your account once and then deploy any repository it can see, private ones included. You pick the repository from a list when you create an instance, and Nextify adds a read-only deploy key to that repository for you. There is no key to copy and paste.
This article covers:
- Linking your account
- Deploying a repository from a linked account
- Disconnecting and revoking access
- Doing it through the API
1. Link your account
- In the portal, open Account → Git accounts.
- Click Connect GitHub or Connect GitLab. You go to GitHub or GitLab to approve.
- Check what Nextify asks for and click Authorize. You come back to the Git accounts page, which says the account is linked.
Good to know:
- Nextify asks GitHub for
repoandread:user, and GitLab forapiandread_user. That is what it takes to list your private repositories and add a deploy key to one. Nextify never pushes code. - The approval page works once and for 10 minutes. If it expires, click Connect again.
- If a provider's button is greyed out with "Not set up yet", linking it is not available yet. Use a deploy key meanwhile.
- You can link more than one account, for example a GitHub user and a GitLab user.
2. Deploy a repository from a linked account
- Open Instances → Create instance and choose the region, plan and SSH keys as usual. Choose an Ubuntu or Debian image.
- Open 6. Startup script, labels and environment and choose Deploy from Git.
- Choose From a linked account, then the account.
- Search for the repository and click it. The branch is filled in with the repository's default branch; change it to deploy another branch or a tag.
- Set the runtime, port and commands as described in Deploy an app from a Git repository, and click Create instance.
When you create the instance, Nextify adds a read-only deploy key to the repository. It is named after the repository and also shows under Account → Deploy keys. Each instance gets its own key.
To add the key, the linked user needs admin rights on the repository on GitHub, or the Maintainer role on GitLab. Without them, the portal says so and nothing is created.
The repository list shows the 100 most recently updated repositories. Search by name to find others.
3. Disconnect and revoke access
On Account → Git accounts, click Disconnect next to the account. Nextify deletes the access it stored. You can no longer pick that account's repositories.
Deploy keys already added to repositories stay, so running instances can still redeploy. To cut them off, delete the key from the repository, or on Account → Deploy keys.
Also revoke Nextify on the provider's side:
- GitHub: Settings → Applications → Authorized OAuth Apps, then Revoke next to Nextify.
- GitLab: Preferences → Applications → Authorized applications, then Revoke next to Nextify.
If you revoke on the provider's side first, the portal says the link has expired. Disconnect it and link it again if you need it.
4. Through the API
Linking itself happens in a browser. Start it with the API and open the address it answers:
curl -sS -X POST https://api.nextifynow.com/v1/git/connections \
-H "Authorization: Bearer $NEXTIFY_TOKEN" -H "Content-Type: application/json" \
-d '{"provider": "github"}'
Then list the linked users with GET /v1/git/connections, their repositories with GET /v1/git/connections/{id}/repos?q=, and create the instance with connection_id and repo in source.git:
curl -sS -X POST https://api.nextifynow.com/v1/instances \
-H "Authorization: Bearer $NEXTIFY_TOKEN" -H "Content-Type: application/json" \
-d '{"name": "shop-1", "machine_type": "sm1.s1-1", "region": "us-west-1", "image": "ubuntu-24.04",
"source": {"git": {"connection_id": "<id from GET /v1/git/connections>", "repo": "your-org/shop", "port": 3000}}}'
The answers to know: 403 forbidden (no admin rights on the repository), 409 link_expired (link the account again) and 502 provider_unavailable (GitHub or GitLab answered with an error; try again). The API documentation has a complete example.