A Probot app triggering deployment events on GitHub based on pull request labels.
-
Install the app from its public page
-
Commit a
.github/deploy.yml
file in your repository with the description of your environments. Spaces must be escaped. You can use whichever environment parameter used by GitHub's deployment API
labels:
Deploy%20to%20Staging:
environment: staging
deploy-to-test:
environment: test
description: A test environment based on Docker
transient_environment: true
auto_merge: false
required_contexts:
- continuous-integration/travis-ci/push
payload:
port: 8080
https: true
- Create matching labels in your repository
- Now just add one of these labels to your PR. The label will automatically be removed once the deployment has been requested.
In case you haven't waited for your Continuous Integration or other integrations to complete, or if one of them has failed and should be considered optional, you will get the comment below. You then have to modify your label description and include a required_contexts
section which will list those contexts which are required. All others will be optional.
If your branch is conflicting with master, your deployment will fail (see below). If you do want to deploy a conflicting branch, then set auto_merge
to false
in your label configuration.
This app works for both github.com and GitHub Enterprise. In the later case, you will need to run your own instance of this app as described in the Pobot documentation. Do not forgot to set the GHE_HOST
environment variable as described here.
If you have suggestions for how deploy could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
For more, check out the Contributing Guide.
ISC © 2020 Alain Hélaïli [email protected] (https://github.com/helaili/deploy)