Deploy with GitHub
Setting up continuous delivery with GitHub and Nokkio
With Nokkio's CLI, you can quickly develop and deploy applications, all from your own computer. As you start working with other developers, you may want to coordinate your deploys through a central tool, often a source control system like GitHub.
Nokkio provides a seamless integration with GitHub that deploys your code in seconds when new commits are pushed to your default branch, and also deploys previews when new pull requests are created, allowing reviewers to easily see how the changes impact your application.
Connecting your project to GitHub
To get started, make sure your Nokkio project is a git repository and has been pushed to a new repository at GitHub. Then, from within the project's directory, run the nokkio connect command.
nokkio connect
GitHub permissions
If this is the first time you are connecting a project to GitHub, Nokkio will need you to grant permissions to the repository. The Nokkio app asks for only the permissions necessary to deploy your code. Here's an overview of those permissions and why we need them:
- Checks (read & write) - Necessary for Nokkio to provide feedback for the status and outcome of various operations taken during deploys.
- Contents (read only) - In order for Nokkio to build and deploy your application, we need access to the source code of the project.
- Deployments (read & write) - Nokkio uses the Deployments API to deploy your code and provide status on the result of those deploys in the GitHub UI.
- Metadata (read only) - This is required by several of the other permissions Nokkio uses, and allows us to access basic information about the repository.
- Pull requests (read only) - Required to provide preview deployments and also facilitate fast-track deploys.
Your first deploy
Once connected, deploying is as simple as pushing a new commit to your default branch. Your code will be queued for deploy and be live in less than a minute. To see the state of your deployments, visit the Deployments page in your GitHub repo, at github.com/your-username/your-repo/deployments.
Preview deployments
When you create a new pull request in your repo, Nokkio will automatically deploy a preview version with the changes from that PR. Preview deployments use a versioned URL so only those who have access to the PR can view them. To find your preview deployment, just watch the pull request page as the Nokkio application will post notifications there when the deploy is ready to view.
Fast-tracked deploys
A major benefit of using the GitHub integration and preview deployments is that when the pull request is eventually deployed, Nokkio will detect when the base commit of the pull request's branch matches the base commit of your main branch and create a fast-track deploy, which skips the build and immediately promotes the preview deployment to production.