slack notif and presentation artifact examples

This commit is contained in:
John Ahigian 2020-07-03 02:16:17 -04:00 committed by GitHub
parent bf40ce018a
commit 0bc3365110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 0 deletions

View File

@ -51,3 +51,30 @@
### Step 5. Congratulations! You now know how to create and run browser tests with GitHub Actions/Workflows!
### **Study [SeleniumBase](https://github.com/seleniumbase/SeleniumBase) to learn more!**
### Slack notifications:
* the action [rtCamp/action-slack-notify](https://github.com/rtCamp/action-slack-notify) is just one of the many slack notification actions available
* create a slack integration webhook if you don't have one already
* create a `SLACK_WEBHOOK` secret on your repository with the webhook token value
* for this particular action, `SLACK_CHANNEL` is optional environment variable and will default to the webhook token channel if not specified
* this example shows how you can put a link to your github action workflow as the `SLACK_MESSAGE` (good for people to see artifacts you can push up such as the SeleniumBase Presenter)
```
- name: Slack notification
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: general
SLACK_ICON_EMOJI: rocket
SLACK_USERNAME: SeleniumBase
SLACK_MESSAGE: 'Actions workflow completed successful! :tada: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
```
### Upload a SeleniumBase presentation as an artifact
* Here is an example how to use [upload-artifact@v2](https://github.com/actions/upload-artifact) to push up a SeleniumBase generated presentation as an artifact. (You can use this in conjunction with the Slack notification to grab and or view the presentation directly from github)
```
- uses: actions/upload-artifact@v2
with:
name: Click here to download SeleniumBase presentation!
path: saved_presentations/my_presentation.html
```