-
Notifications
You must be signed in to change notification settings - Fork 108
132 lines (115 loc) · 3.32 KB
/
integrate.yml
File metadata and controls
132 lines (115 loc) · 3.32 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
name: Test and deploy
on:
push:
branches: [dev]
pull_request:
branches: [dev]
jobs:
test-backend:
name: Test Backend
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
mongodb-version: ['4.4']
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.6.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Install Backend Packages
run: npm ci -f
working-directory: ./backend
- name: Test Backend
run: npm test
working-directory: ./backend
env:
MONGO_URI: mongodb://localhost/accord-test
NODE_ENV: dev
PORT: 3001
WEBSITE_URL: http://localhost:4200
test-frontend:
name: Test Frontend
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
mongodb-version: ['4.4']
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Install Backend Packages
run: npm ci -f
working-directory: ./backend
- name: Start Backend for Frontend e2e
run: npm start &
working-directory: ./backend
env:
MONGO_URI: mongodb://localhost/accord
NODE_ENV: dev
PORT: 3000
WEBSITE_URL: http://localhost:4200
- name: Install Frontend Packages
run: npm ci
working-directory: ./frontend
# FIXME:
# - name: Test Frontend (Unit)
# run: npm start && sleep 20 && npm run test:unit
# working-directory: ./frontend
- name: Test Frontend (e2e)
uses: cypress-io/github-action@v2
with:
browser: chrome
headless: true
start: npm start
wait-on: http://localhost:3000, http://localhost:4200
working-directory: ./frontend
deploy-frontend:
name: Deploy Frontend
runs-on: ubuntu-latest
needs: [test-backend]
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Install Frontend Packages
run: npm ci -f && npm cache clean -f
working-directory: ./frontend
- name: Build Frontend
run: npm run build:prod
working-directory: ./frontend
env:
REACT_APP_VERSION: ${{ github.sha }}
- name: Check index.html
id: check-files
uses: andstor/file-existence-action@v1
with:
files: index.html
- name: Deploy Frontend
if: steps.check-files.outputs.files-exists == 'true'
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: frontend/build
clean: true
clean-exclude: |
CNAME
404.html
redirect-script.html
push-to-stable:
name: Push to Stable
runs-on: ubuntu-latest
needs: [test-backend]
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Push to stable
run: |
git config --global user.name 'Your Name'
git config --global user.email 'Your Email for GitHub'
git push origin HEAD:stable