This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (68 loc) · 2.18 KB
/
Dalichecklist.yaml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Django
on:
schedule:
- cron: '46 22 * * *'
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
Django-AMD64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image Django
run: docker-compose -f "docker-compose.yml" up -d --build
- name: Web site test
run: |
# sh /home/ubuntu/script/curl-check.sh url "http://localhost:35399" stack-name "Django"
#curl -i http://localhost:35399
# - name: Destroy container and file
# run: |
# docker-compose down
# echo "y" | docker image prune -a
# sudo rm -rf /tmp/django/
- name: notify slack
id: slack
uses: slackapi/slack-github-action@v1.24.0
# https://api.slack.com/apps/<your-app-id>/incoming-webhooks
if: ${{ SUCCESS() }}
with:
channel-id: '#github_action_status' # slack channel #alerts-test
payload: |
{
"text": "GitHub Action failed",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Production deployment check failed* :fire_engine:\n High error rate detected after deployment! Rolling back..."
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": ":github: Failed action"
},
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": ":grafana: Grafana dashboard"
},
"url": "https://slack.com/api/chat.delete"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FAIL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK