-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (65 loc) · 2.18 KB
/
node.js.yml
File metadata and controls
89 lines (65 loc) · 2.18 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
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CryptoBase CI AND CD
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.17.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name : Run the Node JS App
working-directory: ./Backend
run: |
npm ci
npm run build --if-present
npm test
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build, Push and Deploy to Heroku
uses: akhileshns/heroku-deploy@v3.12.12 # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} #Must be unique in Heroku
heroku_email: ${{ secrets.HEROKU_EMAIL_ID }}
usedocker: true
appdir: "Backend"
build_front:
needs: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.17.0]
steps:
- name: Checkout the branch
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }} for frontend
uses: actions/setup-node@v2
- name : Run the Node JS App
working-directory: ./Frontend
run: |
npm i -f
deploy_front:
needs: build_front
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build, Push and Deploy to Heroku
uses: akhileshns/heroku-deploy@v3.12.12 # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{ secrets.HEROKU_APP_FRONT_NAME }} #Must be unique in Heroku
heroku_email: ${{ secrets.HEROKU_EMAIL_ID }}
usedocker: true
appdir: "Frontend"