Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit ba6c269

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent 957b8ae commit ba6c269

5 files changed

Lines changed: 79 additions & 4 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Automating deployments to integrators | GitHub API
3+
---
4+
5+
# Automating deployments to integrators
6+
7+
* TOC
8+
{:toc}
9+
10+
The "[Delivering deployments](/guides/delivering-deployments/)" guide describes how to build a server that uses the [Deployments API][deploy API] to easily get your code from GitHub into production. But what if you don't want to host a separate service for deploying code? What if you just want to merge code and have it deploy without thinking about maintaining another app?
11+
12+
You can use the GitHub Auto-Deployment service to receive changes made to your repository and configure it to deliver a deployment to integrators. The Auto-Deployment service can deliver payloads based on two events: whenever a push is made and whenever [the CI status is passing](/guides/building-a-ci-server/).
13+
14+
Here's a diagram demonstrating what the process might look like:
15+
16+
```
17+
+--------------------+ +--------+ +-----------+
18+
| GitHub Auto-Deploy | | GitHub | | Heroku |
19+
| Service | +--------+ +-----------+
20+
+--------------------+ | |
21+
| | |
22+
| Create Deployment | |
23+
|------------------------>| |
24+
| | |
25+
| | |
26+
| | Deployment Event |
27+
| |--------------------------------->|
28+
| | |
29+
| | Deployment Status (pending) |
30+
| |<---------------------------------|
31+
| | |
32+
| | |
33+
| | Deployment Status (success) |
34+
| |<---------------------------------|
35+
| | |
36+
```
37+
38+
{{#tip}}
39+
40+
Note that the Auto-Deployment service only picks up changes from your default branch, which is usually `master`.
41+
42+
{{/tip}}
43+
44+
## Sending deployments whenever you push to a repository
45+
46+
The Auto-Deployment service will be responsible for creating deployments when a push is made to your defalt branch. Next, we'll set up a service to receive those deployment events and handle the deployment of your project.
47+
48+
1. Navigate to the repository where you’re setting up your deployments.
49+
2. In your repository's right sidebar, click <span aria-label="The edit icon" title="The edit icon" class="octicon octicon-tools"></span>.
50+
3. On the left, click **Webhooks & Services**.
51+
![The webhooks and services menu](https://github-images.s3.amazonaws.com/help/settings/webhooks_and_services_menu.png)
52+
4. Click **Add service**, then type "GitHub Auto-Deployment." ![Adding the GitHub Auto-Deployment service](/images/add_github_autodeploy_service.png)
53+
5. Under **GitHub token**, paste an access token you've created. It must have at least the `repo` scope. For more information, see "[Creating an access token for command-line use](https://help.github.com/articles/creating-an-access-token-for-command-line-use)."
54+
6. Under **Environments**, optionally provide a list of environments you'd like to send your deployments to. This can be [any string you define](https://developer.github.com/v3/repos/deployments/#parameters) to describe your environment. The default is "production."
55+
7. If you *only* want builds that successfully passed a continuous test suite, select **Deploy on status**.
56+
8. If you're running this service on GitHub Enterprise, you must pass in your appliance's [endpoint URL](https://developer.github.com/v3/enterprise/#endpoint-urls).
57+
9. Click **Add service**.
58+
59+
## Hooking up an integrator to deployments
60+
61+
To implement our deployments, we'll use Heroku as an example service.
62+
63+
1. Navigate to the repository where you’re setting up your deployments.
64+
2. In your repository's right sidebar, click <span aria-label="The edit icon" title="The edit icon" class="octicon octicon-tools"></span>.
65+
3. On the left, click **Webhooks & Services**.
66+
![The webhooks and services menu](https://github-images.s3.amazonaws.com/help/settings/webhooks_and_services_menu.png)
67+
4. Click **Add service**, then type "Heroku." ![Adding the GitHub Auto-Deployment service](/images/add_heroku_autodeploy_service.png)
68+
5. Type the name of the Heroku application your GitHub repository should deploy to.
69+
6. Enter in your [Heroku OAuth token](https://devcenter.heroku.com/articles/oauth#direct-authorization). You must generate this yourself following the instructions in Heroku's documentation.
70+
7. Under **GitHub token**, paste the same token you provided earlier.
71+
8. Click **Add service**.
72+
73+
From now on, any commits made to your `master` branch--including those generated from merging pull requests--will automatically trigger a deployment to your Heroku application.
74+
75+
[deploy API]: /v3/repos/deployments/

layouts/guides.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ <h2><a href="/v3/">API</a></h2>
3232
<li><h3><a href="/guides/traversing-with-pagination/">Traversing with pagination</a></h3></li>
3333
<li><h3><a href="/guides/building-a-ci-server/">Building a CI server</a></h3></li>
3434
<li><h3><a href="/guides/delivering-deployments/">Delivering deployments</a></h3></li>
35+
<li><h3><a href="/guides/automating-deployments-to-integrators/">Automating deployments to integrators</a></h3></li>
3536
<li><h3><a href="/guides/best-practices-for-integrators/">Best practices for integrators</a></h3></li>
3637
</ul>
3738
</div>

static/css/documentation.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ h1 {
2727
font-size: 36px;
2828
margin: 0em 0 0.5em;
2929
position: relative;
30+
line-height: 30px;
3031
}
3132

3233
.header-anchor {
@@ -625,7 +626,7 @@ a .mega-octicon {
625626
position: relative;
626627
float: right;
627628
margin: 20px 0 0;
628-
width: 280px;
629+
width: 290px;
629630
}
630631

631632
.sidebar-module {
@@ -695,9 +696,7 @@ a .mega-octicon {
695696
}
696697

697698
.sidebar-module h3 a {
698-
padding-top: 8px;
699-
padding-bottom: 8px;
700-
padding-left: 10px;
699+
padding: 8px 10px 8px 10px;
701700
color: #555;
702701
text-decoration: none;
703702
display: block;
19.7 KB
Loading
38.2 KB
Loading

0 commit comments

Comments
 (0)