Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Jan 22, 2025
1 parent 5e54817 commit 97888b1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Now if runway detects an `in_progress` deployment for the `runwaylab/test-flight

Using the `github_deployment` deployment type makes runway the ultimate deployer of your application as far as GitHub deployments are concerned. In order to fully leverage this deployment type, you need to create deployments, and not complete them within GitHub Actions. This is because runway will look for them, run its defined deployment configuration, and then complete them for you!

To see a live example of how this works using [github/branch-deploy](https://github.com/github/branch-deploy) and Actions, checkout this live example [here](https://github.com/GrantBirki/pihole/tree/38b9c166ebb2ea216453b9cf804fee87ad5f853b)
To see a live example of how this works using [github/branch-deploy](https://github.com/github/branch-deploy) and Actions, checkout this live example [here](https://github.com/GrantBirki/pihole/tree/94b3df5063e4ce43d48e2244e87d157528d30935)

## Installation 📦

Expand Down
30 changes: 22 additions & 8 deletions docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,32 @@ schedule:
GitHub deployment events look for a specific environment that has been deployed on GitHub ([learn more about deploying environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment)). This event runs on a schedule and looks for the most recent deployment in the specified environment and checks to see if it is in the `in_progress` state. If it is, it triggers a deployment event.

The most common use case for this event type, is to look for and complete branch-deploy workflows that are triggered via IssueOps in GitHub Actions. Here is a [live example](https://github.com/GrantBirki/pihole/blob/38b9c166ebb2ea216453b9cf804fee87ad5f853b/.github/workflows/branch-deploy.yml).
The most common use case for this event type, is to look for and complete branch-deploy workflows that are triggered via IssueOps in GitHub Actions. Here is a [live example](https://github.com/GrantBirki/pihole/blob/94b3df5063e4ce43d48e2244e87d157528d30935/.github/workflows/branch-deploy.yml).

By using this event type, you can tell `runway` to periodically check a given repo + environment for a deployment in progress and trigger a deployment when it finds one to complete it.

Usage:

```yaml
type: github_deployment # github deployment event
repo: runwaylab/test-flight # the GitHub repository to check for deployment events
environment: production # the specific GitHub environment to check for
deployment_filter: 1 # only look at the most recent deployment (based on the created_at field) - this field is required only for the github_deployment type event. It helps to save on API requests to GitHub. If not provided, it defaults to 1
schedule:
interval: 3s # intervals can be in milliseconds, seconds or minutes (ms, s, or m) - or a cron expression
timezone: UTC # the timezone to use for the schedule (default is UTC) - ex: Europe/Berlin or America/New_York - see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- type: github_deployment # github deployment event
repo: runwaylab/test-flight # the GitHub repository to check for deployment events
environment: production # the specific GitHub environment to check for
deployment_filter: 1 # only look at the most recent deployment (based on the created_at field) - this field is required only for the github_deployment type event. It helps to save on API requests to GitHub. If not provided, it defaults to 1
schedule:
interval: 3s # intervals can be in milliseconds, seconds or minutes (ms, s, or m) - or a cron expression
timezone: UTC # the timezone to use for the schedule (default is UTC) - ex: Europe/Berlin or America/New_York - see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
```

### Branch Deploy Features

You can optionally enable some features to the `github_deployment` event that are specific to the [`branch-deploy`](https://github.com/github/branch-deploy) workflow in GitHub Actions. These features are not enabled by default.

```yaml
- type: github_deployment
# ...
branch_deploy:
enabled: true # enable custom github/branch-deploy payload hydration (required for the features below)
remove_initial_reaction: true # remove the initial reaction from the github/branch-deploy comment (only works if the original comment was made by the owner of the PAT being used to authenticate with the GitHub API)
success_reaction: rocket # react to successful github/branch-deploy comments with a 🚀
failure_reaction: '-1' # react to failed github/branch-deploy comments with a 👎
```

0 comments on commit 97888b1

Please sign in to comment.