forked from ringcentral/slate
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (40 loc) · 1.32 KB
/
deployment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Deployment
on:
workflow_dispatch:
push:
branches: [ master ]
jobs:
deploy-API-documentation:
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'status' && github.event.state == 'success')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.6 # Not needed with a .ruby-version file
bundler-cache: true
- name: Deployment script
run: ./deploy.sh
notify-failure:
runs-on: ubuntu-latest
needs: [deploy-API-documentation]
if: ${{ failure() }}
steps:
- name: Slack notification
uses: 8398a7/action-slack@v3
with:
status: custom
username: CucumberStudio API Documentation
custom_payload: |
{
text: ":fire: CucumberStudio API Documentation deployment failed",
attachments: [{
"color": "warning",
"title": 'GitHub commit: ${{github.sha}}',
"title_link": 'https://github.com/${{github.repository}}/commit/${{github.sha}}',
"text": '${{github.event.commits[0].message}}',
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}