DEPLOY_ERROR_NOTIFY #29
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: DEPLOY_ERROR_NOTIFY | |
on: | |
workflow_run: | |
workflows: [DEPLOY] | |
types: [completed] | |
jobs: | |
on-failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- name: Inject slug/short variables | |
uses: rlespinasse/[email protected] | |
- name: Send notification to lab slack | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ERROR_URL }} | |
if: ${{ env.SLACK_WEBHOOK_URL != '' }} # this should only run if SLACK_WEBHOOK_URL exists | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
# This data can be any valid JSON from a previous step in the GitHub Action | |
payload: | | |
{ | |
"github_username": "${{ env.GITHUB_REPOSITORY_OWNER_PART_SLUG }}", | |
"message": "I'm sorry to report there was an error building and deploying your site. Please see https://smile.gureckislab.org/deploying.html#debugging-deployment-issues" | |
} |