-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42de5c1
commit 075db49
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: branch deploy | ||
|
||
# The workflow to execute on is comments that are newly created | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
# Permissions needed for reacting and adding comments for IssueOps commands | ||
permissions: | ||
pull-requests: write | ||
deployments: write | ||
contents: write | ||
checks: read | ||
statuses: read | ||
|
||
jobs: | ||
# branch-deploy trigger job | ||
trigger: | ||
if: # only run on pull request comments and very specific comment body string as defined in our branch-deploy settings | ||
${{ github.event.issue.pull_request && | ||
(contains(github.event.comment.body, '.deploy') || | ||
contains(github.event.comment.body, '.lock') || | ||
contains(github.event.comment.body, '.noop') || | ||
contains(github.event.comment.body, '.help') || | ||
contains(github.event.comment.body, '.wcid') || | ||
contains(github.event.comment.body, '.unlock')) }} | ||
runs-on: ubuntu-latest | ||
outputs: # set outputs for use in downstream jobs | ||
continue: ${{ steps.branch-deploy.outputs.continue }} | ||
noop: ${{ steps.branch-deploy.outputs.noop }} | ||
deployment_id: ${{ steps.branch-deploy.outputs.deployment_id }} | ||
environment: ${{ steps.branch-deploy.outputs.environment }} | ||
ref: ${{ steps.branch-deploy.outputs.ref }} | ||
comment_id: ${{ steps.branch-deploy.outputs.comment_id }} | ||
initial_reaction_id: ${{ steps.branch-deploy.outputs.initial_reaction_id }} | ||
actor_handle: ${{ steps.branch-deploy.outputs.actor_handle }} | ||
|
||
steps: | ||
# execute the branch-deploy action | ||
- uses: github/branch-deploy@v9 | ||
id: branch-deploy | ||
with: | ||
trigger: '.deploy' | ||
skip_completing: 'true' # we will complete the deployment manually in the 'result' job | ||
admins: 'GrantBirki' | ||
|
||
# this effectively starts a new deployment. runway will look for this new deployment and act on it | ||
# once runway sees this deployment, it will do what it is configured to do (by the user) and then it will complete the deployment as either a success or failure |