Add Slack integration and workflow to send messages #18
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
name: Merge | |
on: | |
merge_group: | |
# Required to make status check pass. | |
pull_request: | |
branches: | |
- main | |
jobs: | |
log: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log event | |
run: | | |
echo "json: ${{ github }}" | |
printenv | |
deploy_staging: | |
if: ${{ github.event_name == 'merge_group' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Deploy to staging | |
run: | | |
echo "Deploying to staging" | |
# Your deployment script here | |
- name: Notify (scuccessful deployment) | |
if: success() | |
uses: ./.github/actions/slack | |
with: | |
message: ":tada: Deployed to staging :white_check_mark: successfully!" | |
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
- name: Notify (failed deployment) | |
if: failure() | |
uses: ./.github/actions/slack | |
with: | |
message: ":fail: Failed to deploy to staging :red_flag: successfully!" | |
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} |