Create README.md #2
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
# Listens for specific comments in PRs and triggers a build | |
name: Build Trigger | |
on: issue_comment | |
jobs: | |
listen_for_deploys: | |
if: ${{ github.event.issue.pull_request && (github.event.comment.body == 'deploy to pre-release' || github.event.comment.body == 'deploy to dev') }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: rocket | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.reactions.createForIssueComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
comment_id: context.payload.comment.id, | |
content: 'rocket' | |
}) | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# could we combine these into one? i don't know how... | |
- name: deploy to pre-release | |
if: ${{ github.event.issue.pull_request && github.event.comment.body == 'deploy to pre-release' }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh workflow run build.yml -f environment=pre-release --ref refs/pull/${{ github.event.issue.number }}/head | |
- name: deploy to dev | |
if: ${{ github.event.issue.pull_request && github.event.comment.body == 'deploy to dev' }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh workflow run build.yml -f environment=dev --ref refs/pull/${{ github.event.issue.number }}/head | |
# Not doing prod-deploy - merge to main first |