Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying from github through Heroku API

Background: I have a project deployed to heroku. The heroku app is connected with github so I can press the "deploy" button from heroku's web api to manually deploy a branch on github to heroku.

What I'm trying to do is build a slack bot that will let me accomplish that via a slack command. Ideally, there'd be some function on heroku's platform api like .deploy('my_app', 'some_branch_on_github), but I can't seem to find it.

The platform api's build feature is close. That function lets you provide the public url of a tarball that heroku will then deploy. However, my github repo isn't public, so that doesn't work. A private repo shouldn't be a problem, though, since heroku's already connected to my github repo.

TLDR: How can I programmatically tell Heroku to deploy my app from a private github it's connected to?

like image 323
Fishtoaster Avatar asked Jul 18 '16 04:07

Fishtoaster


People also ask

How do I deploy a GitHub project to Heroku?

When you enable automatic deploys for a GitHub branch, Heroku builds and deploys all pushes to that branch. If, for example, you have a development app on Heroku, you can configure pushes to your GitHub development branch to be automatically built and deployed to that app.

What are manual deploys in Heroku?

With manual deploys, you can create an immediate deployment of any branch from the GitHub repo that’s connected to your app. Use manual deploys if you want to control when changes are deployed to Heroku. You can also use manual deploys to temporarily deploy a branch other than the one that’s configured for automatic deployment.

How do I deploy Node JS on Heroku?

Open the Settings tab and locate Buildpacks and click “Add buildpack”. Select nodejs from the options and click Save changes. Now, go back to the Deploy tab, and click Deploy Branch at the bottom. Heroku will take the code and host it. Open the Activity tab and there you can see the progress:

How to implement CI/CD workflow in Heroku?

From Heroku, click in your avatar image / Account settings. Go to API Key, click in reveal. Copy the API Key, we are going to use it in the next section. 3. Create a repository in GitHub and implement CI/CD workflow Go to your GitHub account, create a repository and push the project. Then, click on the Settings tab.


1 Answers

I got a response from Heroku's support team asking pretty much the same question. Their answer was that what I'm trying to do is not possible, but will be at some point (although not in the next few months, anyway).

They suggested that I could just use the undocumented web api used by heroku's own web console (a POST to an endpoint on kolkrabbi.heroku.com). They did warn that, as a private api, that's likely to change without warning.

like image 123
Fishtoaster Avatar answered Oct 18 '22 09:10

Fishtoaster