Use repository dispatch to trigger publisher deployment

This commit is contained in:
Andrew Branch
2020-04-09 15:54:04 -07:00
parent bdc4f4cfd1
commit 5b481ab0ab
2 changed files with 12 additions and 2 deletions

View File

@@ -1,11 +1,15 @@
on:
issue_comment:
types: [created]
repository_dispatch:
types: [published]
jobs:
deploy:
if: |
github.event.issue.number == 1
&& github.event.comment.user.login == 'andrewbranch'
github.event_name == 'repository_dispatch' ||
github.event_name == 'issue_comment'
&& github.event.issue.number == 1
&& github.actor == 'andrewbranch'
&& startsWith(github.event.comment.body, '/deploy publisher')
runs-on: ubuntu-latest
steps:

View File

@@ -43,3 +43,9 @@ jobs:
run: npx lerna publish from-git --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: trigger publisher deploy
uses: peter-evens/repository-dispatch@v1.0.0
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: published