-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (73 loc) · 2.12 KB
/
build.yml
File metadata and controls
73 lines (73 loc) · 2.12 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
name: Node.js CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14, 16]
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build:prod:gh-pages --if-present
- name: Test CI
run: npm run test:ci
- name: Upload dist/MobProgramming folder
if: matrix.node == '16'
uses: actions/upload-artifact@v2
with:
name: mob-programming-app
path: dist/MobProgramming
- name: Upload code coverage report
if: matrix.node == '16'
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: coverage/MobProgramming/lcov.info
sonar:
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Download code coverage report
uses: actions/download-artifact@v2
with:
name: code-coverage-report
path: coverage/MobProgramming
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
deploy:
needs: sonar
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Download dist/MobProgramming folder
uses: actions/download-artifact@v2
with:
name: mob-programming-app
path: mob-programming-app
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
folder: 'mob-programming-app'