diff --git a/.github/build_vars.sh b/.github/build_vars.sh index 28ff7d32..f8ce345b 100755 --- a/.github/build_vars.sh +++ b/.github/build_vars.sh @@ -5,6 +5,7 @@ var_list=( 'AWS_SECRET_ACCESS_KEY' 'AWS_DEFAULT_REGION' 'STAGE_PREFIX' + 'SLACK_WEBHOOK_URL' ) set_value() { diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7ef378e8..1e3122b0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -45,6 +45,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_SECRET_ACCESS_KEY] || secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_DEFAULT_REGION] || secrets.AWS_DEFAULT_REGION }} STAGE_PREFIX: ${{ secrets.STAGE_PREFIX }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - name: lock this branch to prevent concurrent builds run: ./.github/github-lock.sh env: @@ -78,3 +79,9 @@ jobs: with: name: test_results path: tests/nightwatch/tests_output + - name: Slack notification + if: env.SLACK_WEBHOOK_URL != '' && contains(fromJson('["develop", "main", "master", "impl", "val", "prod", "production"]'), env.branch_name) && always () + uses: ravsamhq/notify-slack-action@master + with: + status: ${{ job.status }} + notify_when: "failure" diff --git a/README.md b/README.md index 3d4669bb..888ff385 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,20 @@ Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication. ``` +## Slack channel + +To enable slack integration, set a value for SLACK_WEBHOOK_URL in github actions secret. + +To set the SLACK_WEBHOOK_URL: + +- Go to https://api.slack.com/apps +- Create new app : fill in the information +- Add features and funtionality----Incoming webhooks--- activative incoming webooks--- Add new webhook to workspace. +- copy new webhook url and set it as SLACK_WEBHOOK_URL in github actions secret. + +Please join the macpro-quickstart-serverless slack channel to get all build status and also contribute to any ongoing discussions. +Join here: https://join.slack.com/t/macproquickst-ugp3045/shared_invite/zt-mdxpbtkk-SrLRi_yzJrXX3uYgvrbjlg + ### Contributors This project made possible by the [Serverless Stack](https://serverless-stack.com/) and its authors/contributors. The extremely detailed tutorial, code examples, and serverless pattern is where this project started. I can't recommend this resource enough.