-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (36 loc) · 1.13 KB
/
cicd.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
44
45
46
name: Continuous Integration
on:
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Run tests
run: npm test
- name: Send email notification if build fail
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
subject: GitHub Actions - Build Failure
body: |
The recent build has failed.
- Repository: ${{ github.repository }}
- Workflow: ${{ github.workflow }}
- PR Link: ${{ github.event.pull_request.html_url }}
Please check the details in the GitHub Actions logs.
from: CI Bot <[email protected]>