-
Notifications
You must be signed in to change notification settings - Fork 4
200 lines (157 loc) · 4.87 KB
/
ci-cd.yml
File metadata and controls
200 lines (157 loc) · 4.87 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: CI/CD
run-name: Running CI/CD on ${{ github.actor }}'s commits
on:
push:
branches:
- main
pull_request:
permissions:
contents: write
issues: write
pull-requests: write
checks: write
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
backendPreTest:
name: Backend Pre Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/test/backend-pre-test
e2ePreTest:
name: E2E Pre Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@master
with:
version: 10.24.0
cache: true
cache_dependency_path: js/pnpm-lock.yaml
package_json_file: js/package.json
- name: Run pre test
shell: bash
run: cd e2e && pnpm i && pnpm run test
backendTests:
name: Backend Tests
runs-on: ubuntu-latest
needs: backendPreTest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/test/backend-test
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
frontendTests:
name: Frontend Tests
runs-on: ubuntu-latest
needs: backendPreTest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/test/frontend-test
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
testBuildImage:
name: Build Test Docker Image
runs-on: ubuntu-latest
needs: backendPreTest
if: github.ref_name != 'main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/build-image
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
TAG_PREFIX: test-
DOCKER_UPLOAD: false
testBuildStandupBotImage:
name: Build Test Docker Image for codebloom-standup-bot
runs-on: ubuntu-latest
if: github.ref_name != 'main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/build-image/internal/standup-bot
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
DOCKER_UPLOAD: false
validateDBSchema:
name: Validate DB Schema on Prod DB
runs-on: ubuntu-latest
needs: backendPreTest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/validate-db
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
buildImage:
name: Build Docker Image & Upload to Registry
runs-on: ubuntu-latest
needs: [validateDBSchema, backendTests, frontendTests]
if: github.ref_name == 'main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/build-image
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
buildStandupBotImage:
name: Build codebloom-standup-bot Docker Image & Upload to Registry
runs-on: ubuntu-latest
if: github.ref_name == 'main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/build-image/internal/standup-bot
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
redeploy:
name: Redeploy on DigitalOcean
runs-on: ubuntu-latest
needs: buildImage
environment: production
if: github.ref_name == 'main'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/redeploy
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
redeployStandupBot:
name: Redeploy codebloom-standup-bot on Coolify
runs-on: ubuntu-latest
needs: buildStandupBotImage
environment: production
if: github.ref_name == 'main'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run workflow
uses: ./.github/composite/redeploy/internal/standup-bot
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}