Add Slack integration and workflow to send messages (#22) #5
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: Push | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
log: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log event | |
run: | | |
echo "json: ${{ github }}" | |
printenv | |
deploy_production: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Deploy to production | |
run: | | |
echo "Deploying to production" | |
# Your deployment script here | |
- name: Notify (scuccessful deployment) | |
if: success() | |
uses: ./.github/actions/slack | |
with: | |
message: ":tada: Deployed to production :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 production :red_flag: successfully!" | |
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} | |