-
Notifications
You must be signed in to change notification settings - Fork 33
131 lines (118 loc) · 3.86 KB
/
deploy.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Deploy
on:
push:
branches: [master]
workflow_dispatch:
jobs:
notify-build-start:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
# Send build notifications to Slack
- uses: ivelum/github-action-slack-notify-build@v1.6.0
id: slack
with:
channel_id: G054C3DPL
status: STARTED
color: '#ee9b00'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
outputs:
status_message_id: ${{ steps.slack.outputs.message_id }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: ./.github/actions/install-js-dependencies
- uses: ./.github/actions/install-python-dependencies
- run: yarn eslint
- run: yarn stylelint
- run: isort .
- run: flake8 .
# Send notification on check failure
- name: Notify slack fail
uses: ivelum/github-action-slack-notify-build@v1.6.0
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel_id: G054C3DPL
status: FAILED
color: '#d7263d'
deploy-app:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: ./.github/actions/install-js-dependencies
- uses: ./.github/actions/install-python-dependencies
- run: yarn build
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: python run.py deploy-app
# Send notification on build or deploy failure
- name: Notify slack fail
uses: ivelum/github-action-slack-notify-build@v1.6.0
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel_id: G054C3DPL
status: FAILED
color: '#d7263d'
deploy-lambda:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: ./.github/actions/install-python-dependencies
- run: pip install --target lambda-package/dependencies -r lambda-package/requirements.txt
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GOOGLE_API_SERVICE_ACCOUNT_INFO: ${{ secrets.GOOGLE_API_SERVICE_ACCOUNT_INFO }}
GOOGLE_SPREADSHEET_ID: ${{ secrets.GOOGLE_SPREADSHEET_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PIPEDRIVE_TOKEN: ${{ secrets.PIPEDRIVE_TOKEN }}
run: python run.py deploy-lambda
# Send notification on build or deploy failure
- name: Notify slack fail
uses: ivelum/github-action-slack-notify-build@v1.6.0
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel_id: G054C3DPL
status: FAILED
color: '#d7263d'
notify-build-success:
if: ${{ github.event_name == 'push' }}
needs: [deploy-app, deploy-lambda, notify-build-start]
runs-on: ubuntu-latest
steps:
# Send notification on build success
- name: Notify slack success
uses: ivelum/github-action-slack-notify-build@v1.6.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: G054C3DPL
status: SUCCESS
color: '#16db65'