-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.01 KB
/
frontend.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
name: Frontend
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install --prefix frontend
- name: Run the tests and generate coverage report
run: npm test --prefix frontend -- --coverage
- name: Build
run: npm run build --prefix frontend
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Deploy - Github Pages
if: github.event_name == 'push'
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: frontend/build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}