-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (104 loc) · 3.28 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
name: Deploy
on:
push:
branches: [main]
workflow_dispatch:
jobs:
notify-build-start:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
# Send build notifications to Slack
- uses: ivelum/[email protected]
id: slack
with:
channel_id: C0528Q7QK3M
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@v4
- uses: astral-sh/setup-uv@v4
with:
version: '0.5.x'
enable-cache: true
- run: uv run isort .
- run: uv run flake8 .
# Send notification on check failure
- name: Notify slack fail
uses: ivelum/[email protected]
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel_id: C0528Q7QK3M
status: FAILED
color: '#d7263d'
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.136.5'
extended: true
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: hugo && hugo deploy
# Send notification on build or deploy failure
- name: Notify slack fail
uses: ivelum/[email protected]
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0528Q7QK3M
status: FAILED
color: '#d7263d'
deploy-lambda:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
with:
version: '0.5.x'
enable-cache: true
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
PIPE_DRIVE_API_TOKEN: ${{ secrets.PIPE_DRIVE_API_TOKEN }}
PIPE_DRIVE_LEAD_CUSTOM_DATA: ${{ secrets.PIPE_DRIVE_LEAD_CUSTOM_DATA }}
run: uv run run.py deploy-lambda
# Send notification on build or deploy failure
- name: Notify slack fail
uses: ivelum/[email protected]
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel_id: C0528Q7QK3M
status: FAILED
color: '#d7263d'
notify-build-success:
if: ${{ github.event_name == 'push' }}
needs: [notify-build-start, lint, deploy, deploy-lambda]
runs-on: ubuntu-latest
steps:
# Send notification on build success
- name: Notify slack success
uses: ivelum/[email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0528Q7QK3M
status: SUCCESS
color: '#16db65'