-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 1.66 KB
/
main.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Test & Deploy
on:
workflow_dispatch:
push:
branches:
- release
jobs:
test:
runs-on: ubuntu-latest
env:
CI: true
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
with:
node-version: '16'
- name: Checkout Repo
uses: actions/checkout@v2.3.4
with:
fetch-depth: 1
- name: Cache NPM packages
uses: actions/cache@v2.1.6
with:
path: ~/.npm/
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install and Build
run: |
npm install
npm run build
npm run coverage
env:
MONGODB_URL: ${{ secrets.MONGODB_URL }}
- name: Code Coverage Summary
uses: irongut/CodeCoverageSummary@v1.2.0
with:
filename: coverage/cobertura-coverage.xml
output: both
badge: true
format: markdown
indicators: true
- name: Move coverage markdown into directory
run: |
mv code-coverage-results.md coverage
- name: Upload test coverage
uses: actions/upload-artifact@v1
with:
name: coverage
path: coverage
deploy:
needs: test
runs-on: ubuntu-latest
env:
CI: true
steps:
- name: Checkout Repo
uses: actions/checkout@v2.3.4
- name: Deploy to Heroku
uses: AkhileshNS/heroku-deploy@v3.12.12
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "r2-quotes"
heroku_email: ${{secrets.HEROKU_EMAIL}}